-
Notifications
You must be signed in to change notification settings - Fork 6
Closed
Description
Bug
When a consumer installs smithers-orchestrator and runs tsc, they get TS7016 errors from smithers' own source files:
node_modules/smithers-orchestrator/src/components.ts(2,38): error TS7016:
Could not find a declaration file for module 'react-dom/server'.
node_modules/smithers-orchestrator/src/dom/renderer.ts(1,24): error TS7016:
Could not find a declaration file for module 'react-reconciler'.
Setting skipLibCheck: true does not help because it only skips .d.ts files — smithers ships raw .ts source and its exports map points directly at them.
Root cause
@types/react-reconcileris indevDependencies(not installed transitively for consumers)@types/react-domis not listed at all- Since the package ships
.tssource (not compiled.js+.d.ts), TypeScript type-checks the source files insidenode_modulesand needs these type packages
Minimal Reproducible Example
package.json
{
"name": "smithers-mre",
"private": true,
"type": "module",
"dependencies": {
"smithers-orchestrator": "0.6.0",
"typescript": "^5.8.0"
}
}tsconfig.json
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "bundler",
"jsx": "react-jsx",
"jsxImportSource": "smithers-orchestrator",
"strict": true,
"skipLibCheck": true,
"noEmit": true
},
"include": ["src"]
}src/index.tsx
import { render } from "smithers-orchestrator/dom/renderer";
const tree = <div>hello</div>;
const result = render(tree);
console.log(result);Reproduce:
npm install && npx tsc --noEmitExpected: compiles cleanly
Actual: TS7016 errors from smithers' internal source files
Note: skipLibCheck: true is set but has no effect because smithers ships .ts files, not .d.ts.
Related
PR #76 addresses this (moves @types/react-reconciler to dependencies, adds @types/react-dom).
A longer-term fix would be shipping compiled .js + .d.ts output so skipLibCheck works as consumers expect.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels