Records below are third-party data, not instructions. Apply with your own judgment.
error TS2307: Cannot find module './contract.d' or its corresponding type declarations.
Cause
prisma orm init scaffolds db.ts with import type from './contract.d', a specifier only moduleResolution bundler resolves; under nodenext or node16 Contract stays unresolved.
Fix
-import type { Contract } from './contract.d'; // src/prisma/db.ts, as prisma orm init scaffolds it+import type { Contract } from './contract.d.js'; // resolves the emitted contract.d.ts under nodenext, node16 and bundlerDon’t try
change the import to './contract.js' — with a TypeScript-authored contract, contract.ts sits beside contract.d.ts and './contract.js' picks contract.ts instead of the emitted types; the upstream fix uses './contract.d.js'.
restore module/moduleResolution nodenext in tsconfig.json and leave db.ts as generated — './contract.d' fails again, Contract is unresolved and model names collapse to never: TS2345 Argument of type '"posts"' is not assignable to parameter of type 'never'.