Open y471n opened 1 year ago
With Vercel I end up the following error during build:
Error: The Edge Function "_qwik-city" is referencing unsupported modules:
--
06:35:02.062 | - assets/@qwik-city-plan-e244df1e.js: .prisma/client/index-browser
06:35:02.156 | Deployment completed
06:35:02.107 | NOW_SANDBOX_WORKER_EDGE_FUNCTION_UNSUPPORTED_MODULES: The Edge Function "_qwik-city" is referencing unsupported modules: - assets/@qwik-city-plan-e244df1e.js: .prisma/client/index-browser
You need to provide a repo case, we can't help without a way to reproduce it!
Here's a demo Github Repo with the same issue: https://github.com/y471n/qwik-demo-app-with-prisma
Error: The Edge Function "_qwik-city" is referencing unsupported modules:
--
14:36:34.299 | - @qwik-city-plan.js: .prisma/client/index-browser
14:36:34.369 | Deployment completed
14:36:34.331 | NOW_SANDBOX_WORKER_EDGE_FUNCTION_UNSUPPORTED_MODULES: The Edge Function "_qwik-city" is referencing unsupported modules: - @qwik-city-plan.js: .prisma/client/index-browser
Just deploy to Vercel to validate this issue. Let me know if I can help in some way. Thanks @manucorporat
In my project, I also did run into this error on Vercel:
Error: The Edge Function "_qwik-city" is referencing unsupported modules:
--
21:05:07.798 | - @qwik-city-plan.js: .prisma/client/edge
21:05:08.302 | Deployment completed
21:05:07.907 | NOW_SANDBOX_WORKER_EDGE_FUNCTION_UNSUPPORTED_MODULES: The Edge Function "_qwik-city" is referencing unsupported modules: - @qwik-city-plan.js: .prisma/client/edge
Guys, till this is resolved either from Prisma or QwikJS. Any other recommendations of an ORM that plays nice with Qwik?
@y471n
Guys, till this is resolved either from Prisma or QwikJS. Any other recommendations of an ORM that plays nice with Qwik?
https://dev.to/nexxeln/typesafe-database-queries-on-the-edge-5bbn
People have opted for prisma for migrations/schemas and https://github.com/kysely-org/kysely for data access. There's https://github.com/valtyr/prisma-kysely to help bridge the gap.
@y471n - You can't use @prisma/client
on the edge. You can only use Prisma's Data Proxy on the edge via the @prisma/client/edge
package.
This also got me by surprise to be honest!
this week added integration with Prisma and I was not aware of the limitations with the edge
I got this error on vercel too:
TypeError [PLUGIN_ERROR]: Invalid module ".prisma/client/index-browser"
is not a valid package name imported from /vercel/path0/.vercel/output/functions/_qwik-city.func/@qwik-city-plan.js
I've run into a similar issue with another library (ethers
) The problem is that Edge Functions are using a specific environment (not node), so a lot of lib are not working.
One issue though is when you use the lib only on the front, but it ends up in the output for vercel. I would be nice to strip out all frontend specific code (everything inside event$
or useVisibleTask$
) from the server output
@ruheni do you have any insights? Thanks in advance
Which component is affected?
Qwik Rollup / Vite plugin
Describe the bug
I added Prisma in endpoints and tried fetching data with it. The build fails with Netlify with the following error:
Reproduction
NA
Steps to reproduce
No response
System Info
Additional Information
No response