Hi all! I have a question about Prisma seeding. I ...
# orm-help
d
Hi all! I have a question about Prisma seeding. I realize the scope of the question may be somewhat outside Prisma itself, but would appreciate any help/pointers if anyone is willing to offer some. We use Next.js, and following the 1.18.0 release I added
"ts-node": "ts-node --compiler-options '{\"module\":\"CommonJS\"}'"
to
package.json/scripts
to allow it to run. Prior to 1.18.0 I was using the workaround suggested in this GitHub issue by elkevinwolf. All was working fine on my local dev environment, but I’m getting errors when I try to do this as part of a Vercel build. The
seed.ts
file references other lib files in our codebase, almost all of which are ES6 modules. We also have baseUrl set to
.
in
tsconfig.json
– though I think I’ve been able to work around that. I feel that this is a result of my knowledge gap in how modules and compilers function – but since I reference ES6 modules and they have import statements, etc. all with absolute imports utilizing the basePath, things break as those functions get invoked. I’m sorry if this is somewhat vague, happy to provide code examples/errors/etc. – just want to make sure I provide what’s useful.
j
If you could provide a reproduction like a git repository I’ll be happy to check
d
Thanks @Joël! Will send you a message