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
- Add readdir of runtime. Closes #625 Former-commit-id: 574620353df7c7c440c1a45f04c7be9617b4e813 — committed to prisma/prisma by timsuchanek 4 years ago
- Add readdir of runtime. Closes #625 Former-commit-id: 574620353df7c7c440c1a45f04c7be9617b4e813 Former-commit-id: 48e1502efe6ee4d303394dcfdaf10de1928b6885 — committed to prisma/prisma by timsuchanek 4 years ago
@divyenduz as a side node, even after making this modification to the schema.prisma file:
The error persists:
I also see see this: