prisma: [Netlify] Cannot find module '@generated/photon/package.json'

When using a monorepo to separate the client and server code, the following happens:

10:32:36 PM: Function Dir: /opt/build/repo/server/build/functions 10:32:36 PM: TempDir: /tmp/zisi-5dd30d74a36b450008a3f6af 10:32:36 PM: Prepping functions with zip-it-and-ship-it 0.4.0-7 10:32:38 PM: Error: In file “/opt/build/repo/server/build/functions/graphql.js”: Cannot find module ‘@generated/photon/package.json’ from ‘/opt/build/repo/server/build/graphql’ 10:32:38 PM: Error prepping functions 10:32:38 PM: Error running command: Build script returned non-zero exit code: 1

I’m not sure about how to make @generated/photon (located at server/node_modules) discoverable by Netlify’s zip-it-and-ship-it package. Will transitioning to the facade package @prisma/photon solve this automatically? What measures may I take to mitigate the issue until then?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 18 (11 by maintainers)

Most upvoted comments

@kripod Facade will be released in today’s release(Preview 17) so please check that out 😃

Yes, we need to update that guide along with other cloud platforms. Thanks for sharing.

I also got it working without that custom build deploy step. Just deploy like normal.

I can’t promise a timeline as facade need some research and implementation. Currently, we are in the process of implementing it. In the meanwhile, you can deploy your application to something like digitalocean.

Yes, facade should solve this problem. Right now @generated/photon is not in your package.json file so netlify will eliminate it from the function environment.

I’d say you should wait till package facede is released.