prisma: [Mac] "Photon binary for current platform darwin could not be found" when calling typescript netlify function

(Follow up to https://github.com/prisma/prisma2/issues/619)

I took the deployment/platform starter code and:

  • renamed the index.js file to index.ts
  • added the relevant typescript dependencies to package.json
  • modified the netlify.toml file to get functions from “lambda/-”
  • added a “build:lambda”: “netlify-lambda build functions” to the package.json scripts (ran this manually for now to build lambda folder)
  • When I try to hit the endpoint I get the following error:
Request from ::1: GET /.netlify/functions/index
Response with status 500 in 85 ms.
◈ Error during invocation:  Error: Error in Photon: 
Error: Photon binary for current platform darwin could not be found.
  Make sure to adjust the generator configuration in the schema.prisma file:
generator photon {
  provider  = "photonjs"
  platforms = ["native", "linux-glibc-libssl1.0.2", "darwin"]
}
  Please run prisma2 generate for your changes to take effect.
  Note, that by providing `native`, Photon automatically resolves `darwin`.
  Read more about deploying Photon: https://github.com/prisma/prisma2/blob/master/docs/core/generators/photonjs.md
    at NodeEngine.getPrismaPath (/Users/s7au/prisma-examples/deployment-platforms/netlify/lambda/index.js:1:136638)
    at o.<anonymous> (/Users/s7au/prisma-examples/deployment-platforms/netlify/lambda/index.js:1:2370)
    at Generator.throw (<anonymous>)
    at o (/Users/s7au/prisma-examples/deployment-platforms/netlify/lambda/index.js:1:1573)

Is this a bug or am I doing something incorrectly? EDIT: this isn’t specific to typescript. The issue occurs even if it’s index.js

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 16 (5 by maintainers)

Commits related to this issue

Most upvoted comments

@divyenduz as a side node, even after making this modification to the schema.prisma file:

generator photon {
  provider  = "photonjs"
  platforms = ["native", "linux-glibc-libssl1.0.2", "darwin"]
}

The error persists:

◈ Error during invocation:  Error: Error in Photon: 
Error: Photon binary for current platform darwin could not be found.
  Make sure to adjust the generator configuration in the schema.prisma file:
generator photon {
  provider  = "photonjs"
  platforms = ["native", "linux-glibc-libssl1.0.2", "darwin", "darwin"]
}

I also see see this:

Generating Photon.js Client to /Users/s7au/prisma-examples/deployment-platforms/netlify/node_modules/@generated/photon
> Downloading linux-glibc-libssl1.0.2 and darwin binaries [====================] 100%