test(driver-adapters-wasm): describe failing Qwik + Vercel Edge scenarios #5203
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
DO NOT MERGE
This PR describes the failing scenario of Qwik City + Vercel Edge + Wasm
driverAdapters
.The
turso-vercel-qwik-edgemw
project in this PR exposes an endpoint,/demo/users
, which invokes Prisma Client + Turso and returns a JSON object with some preloaded database results.Notably, this setup requires using the
vercel-edge
adapter for Qwik City: https://qwik.dev/docs/deployments/#adapters-and-middleware.The TL/DR of the scenario is: in order to run a Qwik City app on Vercel Edge, one needs a custom Vite plugin, which apparently is only used on deployed apps (so not on local
pnpm build
+pnpm dev
). For Vercel Edge, this plugin canonically lives in./adapters/vercel-edge/vite.config.ts
. There's no known way of making this scenario work.None of the approaches mentioned in prisma/prisma#21094 or QwikDev/qwik#4075 led to successful results, but here are some findings related to
./adapters/vercel-edge/vite.config.ts
:This plugin works locally, but fails at compile time when deploying this project with
vercel
:Local runtime output:
Compilation failure on Vercel:
TypeError [PLUGIN_ERROR]: Invalid module ".prisma/client/default" is not a valid package name imported from /vercel/path0/.vercel/output/functions/_qwik-city.func/@qwik-city-plan.js
@Jolg42 had mentioned in [🐞]Building Prisma with Vercel-Edge generates compile errors QwikDev/qwik#4075 (comment) that the following worked for him:
Unfortunately that's not the case for me. However, by slightly tweaking the
resolve
block toI was at least able to deploy on Vercel. Compilation works fine, but at runtime,
/demo/users
returns error 500.Looking at the Vercel logs, I see the following error:
The problems potentially lie in 3 different code areas:
./adapters/vercel-edge/vite.config.ts
Problem resolution feedback is welcome.
Internal: environment variables like
DRIVER_ADAPTERS_TURSO_VERCEL_QWIK_EDGEMW_PROJECT_ID
andDRIVER_ADAPTERS_TURSO_VERCEL_QWIK_EDGEMW_DATABASE_URL
are not yet set by the CI, but I think that's beside the point. The screenshots I've posted come from a private Vercel account of mine. I'd be happy if somebody could set those private tokens for me, but I unfortunately don't expect to see a green CI after that.