Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heroku/dokku: start failing with v0.5.0 #505

Closed
iherger opened this issue Oct 25, 2019 · 4 comments
Closed

Heroku/dokku: start failing with v0.5.0 #505

iherger opened this issue Oct 25, 2019 · 4 comments

Comments

@iherger
Copy link

iherger commented Oct 25, 2019

I cloned the Prisma2 GraphQL Auth starter, and deployed to Heroku (with some minor changes, like adding NEXUS_SHOULD_GENERATE_ARTIFACTS=true to the build script and fixing a type error [due to photon.users.findOne now returning User|null]).

Building on Heroku/dokku runs smoothly, but starting the server gives the following error:

node dist/server
/app/node_modules/nexus/dist/plugins.js:70
      throw new Error("Plugin " + plugin.config.name + " failed on \"onInstall\" hook:\n\n" + error.stack);
                       ^
Error: Plugin nexus-prisma failed on "onInstall" hook:
Error: Could not find photon package at @generated/photon. Check that you have configured your Photon generator block in schema.prisma correctly and run prisma generate.

Reproduction available: https://github.com/iherger/hello-heroku

I get the same error (Could not find photon package at @generated/photon) when I try to start my own project.

Not sure if this is a photon or nexus-prisma error, feel free to move the issue to wherever it belongs.

@iherger
Copy link
Author

iherger commented Oct 26, 2019

It seems that the pruning devDependencies step for dokku/Heroku deployments is now removing node_modules/@generated/photon (which was not the case previously).

So, skipping the pruning devDependencies step makes it work again.

Moving prisma2 and @prisma/sdk to prod dependencies, does not work.

I still wonder what root cause of this is.

@jasonkuhrt
Copy link
Member

jasonkuhrt commented Oct 29, 2019

So, skipping the pruning devDependencies step makes it work again.

How did you do this exactly?

Facades should resolve this issue.

@iherger
Copy link
Author

iherger commented Oct 29, 2019

How did you do this exactly?

You can set NPM_CONFIG_PRODUCTION to false to skip pruning (see https://devcenter.heroku.com/articles/nodejs-support#skip-pruning)

@jasonkuhrt
Copy link
Member

jasonkuhrt commented Oct 30, 2019

@iherger thanks, did not know about that feature. Appears to be a Heroku specific env var.

@iherger iherger closed this as completed Dec 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants