mini-van
mini-van copied to clipboard
nodenext file resolution: Type error TS2307 Cannot find module 'mini-van-plate/van-plate' or its corresponding type declarations.
trafficstars
When importing mini-van-plate/van-plate from a package with the tsconfig.json:
{
"compileOnSave": true,
"compilerOptions": {
"module": "ESNext",
"moduleResolution": "nodenext",
"target": "ESNext",
"strict": true
},
"exclude": [
"node_modules"
],
"references": []
}
The following error occurs:
Type error TS2307
Cannot find module 'mini-van-plate/van-plate' or its corresponding type declarations.
See the workaround to resolve this issue. As far as I know, it's the simpler one of two solutions. Basically, you have to have the source files in the root directory (no src/ directory), add files: to package.json, & have "moduleResolution": "nodenext" in tsconfig.json.
Similar issues were raised (#2, #4) before. I think https://github.com/vanjs-org/mini-van/issues/2#issuecomment-1701978240 is the solution.