mini-van icon indicating copy to clipboard operation
mini-van copied to clipboard

nodenext file resolution: Type error TS2307 Cannot find module 'mini-van-plate/van-plate' or its corresponding type declarations.

Open btakita opened this issue 2 years ago • 1 comments
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.

btakita avatar Nov 14 '23 09:11 btakita

Similar issues were raised (#2, #4) before. I think https://github.com/vanjs-org/mini-van/issues/2#issuecomment-1701978240 is the solution.

Tao-VanJS avatar Nov 14 '23 16:11 Tao-VanJS