error: prisma schema validation - (get-config wasm)
Fixes Prisma schema validation failing inside the get-config wasm step. Use when prisma validate or generate fails with a wasm-flavored validation error, after upgrading Prisma versions, or when an agent edited schema.prisma by hand. Not for datasource.url errors, for migration drift, or for engine download failures.
TL;DR
The get-config wasm error means Prisma's schema parser (compiled to wasm) rejected your schema.prisma before any database work started. Run npx prisma validate to get the real message, fix the schema syntax or the version mismatch between CLI and schema features, and keep the CLI and engines on the same version.
error: prisma schema validation - (get-config wasm)Use this when
prisma validate,generate, ormigratefails with this wasm error- The failure started right after a Prisma version bump
- An agent hand-edited schema.prisma
Not for this skill when
- The error is specifically about datasource.url (thats the env wiring)
- Migrations fail on drift or conflicts (thats the database, not the parser)
- Engines fail to download (thats network or platform)
Steps
- Get the real validation message with the validate command:
npx prisma validateExpected output: a specific error like "missing datasource block" or "unknown attribute" with a line number. The wasm wrapper hides this detail; validate surfaces it.
- Check for version skew between the CLI and the schema features used:
npx prisma --versionExpected output: one version for CLI and engines. If the schema uses a preview feature or syntax from a newer version than the installed CLI, the wasm parser rejects it. Align them with a single npm install prisma@[version].
- Run the formatter; it catches structural problems the eye misses:
npx prisma formatExpected output: the schema is rewritten cleanly, or format fails pointing at the broken block. Unclosed braces and stray characters are the usual finds.
- If it broke right after an upgrade, check the upgrade guide for removed syntax:
npm ls prisma @prisma/clientExpected output: both packages on the same version. A newer @prisma/client with an older prisma CLI (or vice versa) is the most common cause of wasm validation failures.
Variant phrasings
validation fails only in CI
CI installed a different Prisma version than local (lockfile drift). Commit the lockfile and install with npm ci.
get-config wasm error with a multi-schema setup
Each schema file is validated independently; run validate per schema with --schema to find which one breaks.
Why it happens
Prisma compiles its schema parser to WebAssembly so it runs the same everywhere. When the schema has a syntax error or uses features the installed parser version doesnt know, the wasm module throws this generic error instead of a friendly message. Version skew is the top cause because npm makes it easy to end up with a CLI and client from different releases.
Edge cases
- Environment variable references like
env("X")are fine to the parser; it only checks structure, not values. - Comments cant contain unescaped special sequences in some positions; format usually fixes them.
- If validate passes but generate still fails at get-config, clear the Prisma cache and node_modules and reinstall; stale engine binaries cause phantom failures.
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_ZRhafV-iiAyka6fe2CzY7Q