-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
This isn't really a Prisma issue, it's the
Three ways to fix it, pick one: 1. Run TypeScript directly with npx tsx src/index.tsNo build step, no resolution mismatch. This is what most starter projects use. 2. Switch to {
"compilerOptions": {
"module": "NodeNext",
"moduleResolution": "nodenext",
"target": "ES2023",
"strict": true,
"esModuleInterop": true
}
}With 3. Compile to CommonJS {
"compilerOptions": {
"module": "CommonJS",
"moduleResolution": "node",
"target": "ES2023",
"strict": true,
"esModuleInterop": true
}
}Easiest for short scripts since CJS resolution doesn't care about extensions. Summary: |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.

switching to
nodenextdidn't work either. still had the same error for my imports, as well as prisma's importsusing
tsxcan work, however there is an official solution for this. we can update ourschema.prismafile to reflect the following:this makes sure that when we generate our prisma client, it includes the specified file extension in it's import statements
https://www.prisma.io/docs/orm/reference/prisma-schema-reference#fields-for-prisma-client-provider