svelte-kanban
svelte-kanban copied to clipboard
Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is NodeNext
I'm using NodeJS 20 with Typescript 5.2.
When I remove "moduleResolution": "NodeNext"
, everything seems to be fine. Apps can use this component as a library. I'm curious whether doing so is a bad idea. Will this bite us later?
- Check out this branch
- Change
tsconfig.json
and add"moduleResolution": "NodeNext"
under"compilerOptions":
This setting is described here. SvelteKit 1.24+ includes this setting when it is used to create a new app. Perhaps it is no longer needed in Typescript 5.2. In fact the article states that"module":
should be set toNodeNext
too (SvelteKit doesn't add it). - Open
src/lib/stores/index.ts
in VSCode.src/lib/stores/board.ts
exists in this folder. The error on every file (egexport * from './board';
) is:
Relative import paths need explicit file extensions in EcmaScript imports when
'--moduleResolution' is 'node16' or 'nodenext'. Did you mean './board.js'? ts(2835)