Current behavior
Seeding with .js files throws the following error in console:
Seeding based on yarn ts-node ./database/seeding/seed.ts !
â–¸ cross_spawn_1.default is not a function
Reproduction
prisma.ymlseed:
# import: seed.graphql
run: yarn ts-node ./database/seeding/seed.ts
Run prisma seed, receive the error
Expected behavior?
No error, the script will run
Additional notes
Using a post-deploy hook will run the script, but that's not optimal seeing as it will run on every deploy, and cannot be used with prisma seed command
hooks:
post-deploy:
- graphql get-schema --project database
- graphql codegen
- yarn ts-node ./database/seeding/seed.ts
My seed.ts for reference:
const TAG = 'seed.ts';
console.log(TAG, `Hello from seed!\n`);
const seed = () => {
console.log(TAG, `in function\n`);
};
seed();
Output from prisma version:
prisma/1.8.3 (darwin-x64) node-v10.2.1
Issue discussed in forum
Note, dublicate report here - both authors came here from same forum discussion at @marktani 's request 😄 Contributors can let either of us know which one to close
Fixed here in alpha channel - https://github.com/prismagraphql/prisma/pull/2569
Will be released as per the new release process.
Will close the issue as this hits stable channel.
This is released in Prisma CLI version 1.9+ 🎉
Most helpful comment
Fixed here in alpha channel - https://github.com/prismagraphql/prisma/pull/2569
Will be released as per the new release process.
Will close the issue as this hits
stablechannel.