Prisma generate command not working after upgrading


#1

I have the below prisma.yml file:

endpoint: ${env:PRISMA_ENDPOINT}
datamodel: datamodel.prisma
secret: ${env:PRISMA_SECRET}

generate:
  - generator: javascript-client
    output: generated/prisma-client/
  - generator: graphql-schema
    output: generated/

hooks:
  post-deploy:
    - echo "Deployment finished"
    - prisma generate

After upgrading to version 1.23.4, the generate command fails with the below error. Has the generate command been replaced with something new?

▸    Error parsing plugin
 ▸    /dummy-prisma-api/node_modules/prisma-cli-core

 ▸    'MODULE_NOT_FOUND': Cannot find module
 ▸    '../../../../../prisma-datamodel/dist/datamodel/scalar'

 ▸    Error parsing plugin
 ▸    /dummy-prisma-api/node_modules/prisma-cli-core

 ▸    'MODULE_NOT_FOUND': Cannot find module
 ▸    '../../../../../prisma-datamodel/dist/datamodel/scalar'

 ▸    Error parsing plugin
 ▸    /dummy-prisma-api/node_modules/prisma-cli-core

 ▸    'MODULE_NOT_FOUND': Cannot find module
 ▸    '../../../../../prisma-datamodel/dist/datamodel/scalar'

 ▸    generate is not a prisma command.
 ▸    Perhaps you meant version
 ▸    Run prisma help for a list of available commands.

#2

Are you using graphql-yoga or something? try using the following

hooks:
 post-deploy:
  - graphql get-schema -p prisma

#3

Hey S_M. Yes i should’ve mentioned that i’m using graphql-yoga along with the prisma client. The prisma.yml setup that i pasted previously worked, but then started erring after updating my prisma version. I can still run prisma generate from the command line and the command runs without any errors. If i am not mistaken, graphql get-schema only fetches the updated schema, whereas in the prisma.yml I am also trying to generate a prisma javascript client.


#4

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.