Prisma-client-js: Test Photon on Heroku

Created on 3 Jul 2019  路  8Comments  路  Source: prisma/prisma-client-js

Placeholder. Reminder to test if it works or not.

kinfeature

Most helpful comment

Sorry to necro an old thread, but for those encountering a similar issue with heroku pruning @generated, here are the relevant heroku docs on how to disable that behaviour.

All 8 comments

We need to resolve linux-glibc or equivalent for Heroku.

Regarding making the heroku use-case rock solid it's worth noting my comment on stateless builds which is what heroku supports (and is limited to) for it's pipelines.

I'm using photon for prototype work on Heroku now (fantastic tooling). I'll be sure to share any notable issues I run into here.

My first (non-obvious) issue is that heroku, by default, runs npm prune on builds which removes the @generated module. @divyenduz pointed me to the docs (https://github.com/prisma/prisma2/blob/master/docs/photon/codegen-and-node-setup.md) -- glad its config driven. npm prune was a fairly normal part of my build process on other platforms as well, so I expect this will come up in other places as well.

I've just tested a demo deploy to heroku and it works well so far.

  1. Ran prisma2 init and chose the typescript auth & permission starter project with sqlite.
  2. Ran npm run seed, (fails on prisma2 init because i don't have ts-node globally installed).
  3. Moved all devDependencies to dependencies because heroku prunes devDependencies and it's running with ts-node so devDependencies needs to be available at runtime . Thank you @cloverich for the hint.
  4. Deployed to heroku via heroku cli as described on heroku about deploying nodejs apps.

And it just works :)

Great job Prisma team!

Awesome! <3

Thanks for letting us know. I will close this one then :)

@emolr Did you happen to be using typescript? I can't seem to get the typescript setup working. It errors with

remote:        src/types/Post.ts(6,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Post">'.
remote:        src/types/Post.ts(9,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Post">'.
remote:        src/types/Post.ts(10,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Post">'.
remote:        src/types/Post.ts(11,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Post">'.
remote:        src/types/Post.ts(12,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"Post">'.
remote:        src/types/User.ts(6,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"User">'.
remote:        src/types/User.ts(7,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"User">'.
remote:        src/types/User.ts(8,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"User">'.
remote:        src/types/User.ts(9,7): error TS2339: Property 'model' does not exist on type 'ObjectDefinitionBlock<"User">'.

This happens in the build phase, so heroku hasn't pruned as yet. Seems like typescript can't find node_modules/@types/nexus-typegen/index.d.ts that's generated by the generate:nexus script

@iRoachie Please open a new issue about this here: https://github.com/prisma/nexus-prisma

Sorry to necro an old thread, but for those encountering a similar issue with heroku pruning @generated, here are the relevant heroku docs on how to disable that behaviour.

Was this page helpful?
0 / 5 - 0 ratings