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

Prisma2 not working with netlify-lambda #1015

Closed
seawatts opened this issue Nov 28, 2019 · 15 comments
Closed

Prisma2 not working with netlify-lambda #1015

seawatts opened this issue Nov 28, 2019 · 15 comments
Assignees
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. team/client Issue for team Client. tech/typescript Issue for tech TypeScript. topic: serverless
Milestone

Comments

@seawatts
Copy link

seawatts commented Nov 28, 2019

I am using the netlify lambda cli. Not the netlify cli. https://github.com/netlify/netlify-lambda

Following up from the discussion here: #952

When I try to run prisma2 generate I get this error

Error: The `platforms` field on the generator definition is deprecated. Please rename it to `binaryTargets`.

When I switch platforms to binaryTargets it runs generate fine. But I still get this error on invocation

Request from ::1: GET /.netlify/functions/hello
Response with status 500 in 528 ms.
Error during invocation:  Error: Error in Photon: 
Error: Photon binary for current platform darwin could not be found.
Photon looked in null but couldn't find it.
Make sure to adjust the generator configuration in the schema.prisma file:
generator photon {
  provider      = "photonjs"
  binaryTargets = ["native", "rhel-openssl-1.0.x", "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 (~/bot-slack/lambda/hello.js:1:894920)
    at async ~/bot-slack/lambda/hello.js:1:896510
    at u.<anonymous> (~/bot-slack/lambda/hello.js:1:2379)
    at Generator.throw (<anonymous>)
    at u (~/bot-slack/lambda/hello.js:1:1380)

Here is my generator section of my schema.prisma

generator photon {
  provider = "photonjs"
  binaryTargets = ["native", "rhel-openssl-1.0.x"]
}

Even if I try adding darwin to that list it still errors, and just adds another darwin to the error message.

Make sure to adjust the generator configuration in the schema.prisma file:

generator photon {
  provider      = "photonjs"
  binaryTargets = ["native", "rhel-openssl-1.0.x", "darwin", "darwin"]
}
@pantharshit00
Copy link
Contributor

I am able to reproduce this. This is related to how photon should be handled with bundlers.

image

We already have issues on that: prisma/prisma-client-js#119
https://github.com/prisma/specs/issues/336

Marking as a bug for now

@pantharshit00 pantharshit00 added bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. labels Dec 3, 2019
@pantharshit00 pantharshit00 removed their assignment Dec 3, 2019
@heymartinadams

This comment has been minimized.

@pantharshit00

This comment has been minimized.

@heymartinadams

This comment has been minimized.

@pantharshit00

This comment has been minimized.

@heymartinadams

This comment has been minimized.

@pantharshit00

This comment has been minimized.

@heymartinadams

This comment has been minimized.

@janpio

This comment has been minimized.

@janpio
Copy link
Member

janpio commented Apr 21, 2020

Internal Note: Opened issue for Netlify, waiting for progress there.

@janpio
Copy link
Member

janpio commented Mar 24, 2021

Issue netlify/netlify-lambda#229 at netlify-lambda side has been auto closed :(

@janpio janpio added the team/client Issue for team Client. label Mar 24, 2021
@pantharshit00
Copy link
Contributor

I am not sure people are even using that package. Seems like netlify dev is the new cli now.

These multiple CLIs from netlify is confusing.....

@janpio
Copy link
Member

janpio commented Mar 26, 2021

@verythorough
Copy link

Hello from Netlify! In the years since netlify-lambda was created, we've since released direct bundling and shipping of JavaScript functions, so you no longer need to add a step to build your functions using netlify-lambda.

Also, as @pantharshit00 noted, we added the dev command to Netlify CLI, which serves JS functions directly, again with no need for a separate build tool. (The docs reflect these recommendations as well.)

The one remaining functionality that netlify-lambda provides is webpack bundling. We're currently working on expanding our functions bundler options directly in the build, so we'll soon be able to replace that functionality, too. When that happens, we'll be able to archive netlify-lambda.

@janpio
Copy link
Member

janpio commented Mar 26, 2021

Thank you so much for this update @verythorough - considering this development I think it is safe for us to close this issue and focus our efforts on other areas.

@janpio janpio closed this as completed Mar 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. team/client Issue for team Client. tech/typescript Issue for tech TypeScript. topic: serverless
Projects
None yet
Development

No branches or pull requests

7 participants