-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gentype: error TS2307: Cannot find module XXX or its corresponding type declarations. #6521
Comments
PR #6516 should fix this issue. |
It was intended change and you should add |
Actually, my |
Hmm, what value of |
|
{
"compilerOptions": {
"paths": {
"@assets/*": [
"./src/*"
],
"@components/*": [
"./@components/*"
],
"@pages/*": [
"./pages/*"
],
"@utils": [
"./@utils"
]
},
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
"noEmit": true,
"incremental": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve"
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx"
],
"exclude": [
"node_modules"
]
} |
I think you explicitly excluded |
Hmm, I cannot reproduce the error even with the same It's weird because it is necessary to checking the gentype outputs is correct in TypeScript. That means you have actually incorrect files generated. |
I can see |
I remove I found the ts error seems gone if I change the // AddressSelect.gen.tsx
// Error
import * as AddressSelectBS from './AddressSelect';
// Ok
import * as AddressSelectBS from './AddressSelect.mjs'; // add '.mjs' Any related? |
That sounds like you are actually not using the Specifying |
I've tried |
FYR, my rescript.json {
"name": "farmmoa-web",
"version": "0.1.0",
"jsx": {
"version": 4,
"mode": "automatic"
},
"sources": [
{
"dir": "src",
"subdirs": true
}
],
"package-specs": [
{
"module": "es6",
"in-source": true
}
],
"suffix": ".mjs",
"namespace": false,
"pinned-dependencies": [],
"bs-dependencies": [],
"bs-dev-dependencies": [],
"ppx-flags": [],
"warnings": {
"error": true,
"number": "-48"
},
"bsc-flags": [
"-open RescriptCore"
],
"gentypeconfig": {
"language": "typescript",
"shims": {},
"generatedFileExtension": ".gen.tsx",
"module": "es6",
"moduleResoultion": "node16",
"debug": {
"all": false,
"basic": false
}
}
} |
There's a typo. |
Oops! I confirm that |
Since v11-rc.5, the annotation for the linter of output seems changed
This causes the TS error TS2307: Cannot find module XXX or its corresponding type declarations.
The text was updated successfully, but these errors were encountered: