Prisma1: CLI: prisma generate fails as post-deploy hook

Created on 11 Mar 2019  路  8Comments  路  Source: prisma/prisma1

Describe the bug
When installing prisma via homebrew the post-deploy hook prisma generate fails because of a missing module.

To Reproduce
Follow the Get Started tutorial

  1. Set up Prisma
  2. Change Datamodel

After adding prisma generate as a post-deploy hook here is what my prisma.yml looks like...
Screen Shot 2019-03-11 at 1 28 20 AM

Below is the output upon executing prisma deploy...
Screen Shot 2019-03-11 at 1 25 06 AM

Expected behavior
When executing prisma generate on the command line, prisma successfully generates both the schema and the client in the generated directory. I would expect the same behavior when prisma generate is executed as a post-deploy hook.

Versions:

  • Connector: Postgres
  • Prisma Server: 1.27.0
  • prisma CLI: prisma/1.28.0 (darwin-x64) node-v10.4.1
  • OS: OS X Mojave 10.14.3
  • other dependencies: prisma-client
bu2-confirmed arebrew kinbug

All 8 comments

@RobertShaw1 : Did you install Prisma using brew or npm?

I installed Prisma using brew. This is mentioned at the very beginning of the issue.

@timsuchanek : What additional info is needed for this issue?

@RobertShaw1 : Thanks, this information is enough, I am able to reproduce. However, this would need more debugging from my end for a fix.

@divyenduz : Thanks. I just wanted to make sure the issue didn't get closed or marked as stale because there was additional info I needed to submit. Your efforts are much appreciated.

@RobertShaw1

Can you please try the new version(1.30) from homebrew?

@pantharshit00
I got the same error message as described above.
Screen Shot 2019-04-10 at 10 01 16 PM

I confirm this is happening in 1.31.0 (version 1.31.1 wasn't available in brew when I checked for updates).

As a workaround, appending sh -c solves the issue:

endpoint: http://localhost:4466
datamodel: datamodel.prisma

hooks:
  post-deploy:
    - sh -c prisma generate

I checked output of which prisma from post-deploy hook and it's the same as running it outside: /usr/local/bin/prisma. I also tried to remove node_modules/package.json just to confirm, that the app doesn't load any local files, but the error persists.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AlessandroAnnini picture AlessandroAnnini  路  3Comments

marktani picture marktani  路  3Comments

ragnorc picture ragnorc  路  3Comments

schickling picture schickling  路  3Comments

schickling picture schickling  路  3Comments