Prisma1: Prisma seed with .js files throws error in console

Created on 1 Jun 2018  Â·  3Comments  Â·  Source: prisma/prisma1

Bug Report

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

  1. Use Typescript Advanced boilerplate
  2. Make the following changes to prisma.yml
seed:
  # 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

bu2-confirmed arecli

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 stable channel.

All 3 comments

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+ 🎉

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tbrannam picture tbrannam  Â·  3Comments

akoenig picture akoenig  Â·  3Comments

nikolasburk picture nikolasburk  Â·  3Comments

jannone picture jannone  Â·  3Comments

ragnorc picture ragnorc  Â·  3Comments