hi, I am upgrading to prisma 7 in my nest js project and in the migration guide they say set the following:
package.json
{
"type": "module",
"scripts": {...},
}
tsconfig.json
{
"compilerOptions": {
"module": "ESNext",
"moduleResolution": "node",
"target": "ES2023",
"strict": true,
"esModuleInterop": true
}
}
But when I try to run the project I get this error:
➜ poc_collector yarn translation
> SWC Running...
Successfully compiled: 224 files, copied 546 files with swc (300.25ms)
file:///Users/dennis/Projects/poc_collector/dist/main.js:2
Object.defineProperty(exports, "__esModule", {
^
ReferenceError: exports is not defined in ES module scope
This file is being treated as an ES module because it has a '.js' file extension and '/Users/dennis/Projects/poc_collector/package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.
at file:///Users/dennis/Projects/poc_collector/dist/main.js:2:23
at ModuleJob.run (node:internal/modules/esm/module_job:271:25)
at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:547:26)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:116:5)
Is there a guide for es modules with nest js that I am missing?