prisma-kysely icon indicating copy to clipboard operation
prisma-kysely copied to clipboard

Support for node16 and nodenext module resolution

Open tonybruess opened this issue 2 years ago • 1 comments

Hi there,

The generated types.ts file is importing ./enums. When using node16 or nodenext the import should be ./enums.js.

The error is:

error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './enums.js'?

tonybruess avatar Jan 04 '24 17:01 tonybruess

is there any solution to this?

moh1434 avatar Feb 13 '25 10:02 moh1434

My understanding is that .js will work under cjs and esm conditions (covering node10, node16, nodenext) and that the biggest difference is that we should use .ts if allowImportingTsExtensions is enabled.

Work for 2.0.0 is currently being done in @ArthurFiorette's fork, so I've opened a pull request there that will eventually be merged back here.

alii avatar Jun 24 '25 12:06 alii