v0.0.85
What's Changed
- Docs: Tailwind CSS edits by @arimendelow in #456
- Doc typos by @standuprey in #458
- 🔥 Removed turnstile from the tutorial by @ahaywood in #459
- 🔥 Removed reference to Turnstile in Tutorial by @ahaywood in #460
- Ensure prisma client initialized after wasm engine initialized by @justinvdm in #461
- Adding a bit more info about our design principles by @peterp in #462
- fix: Fix WASM support + Prisma >6.7 support by @justinvdm in #463
- feat: Support prisma >6.7 in standard starter by @justinvdm in #457
Full Changelog: v0.0.84...v0.0.85
New Contributors
- @standuprey made their first contribution in #458
Support for Prisma >6.7
Usage of RedwoodSDK in this version with Prisma <6.7 should still work the same as before without any changes.
For upgrading Prisma, here's a migration guide based on how we've updated the standard starter
🔁 Prisma >6.7 migration guide for existing projects
Prisma introduced a new client generator (prisma-client) that lets us generate a client specific to Cloudflare workers (via workerd runtime) and ESM - this makes for much simpler and less error prone Vite integration.
This guide walks you through upgrading an existing RedwoodSDK Standard Starter project.
1. ✅ Update Dependencies
Update the following packages in your package.json:
-"rwsdk":"0.0.84",
- "@prisma/adapter-d1": "~6.5.0",
- "@prisma/client": "~6.5.0",
- "prisma": "~6.5.0",
+"rwsdk":"0.0.85",
+ "@prisma/adapter-d1": "~6.8.2",
+ "@prisma/client": "~6.8.2",
+ "prisma": "~6.8.2",
Also upgrade wrangler to at least ^4.16.0.
- "wrangler": "^4.14.1"
+ "wrangler": "^4.16.0"
Then make sure you've installed these packages, depending on your package manager:
npm install
# or
pnpm install
# or
yarn install
2. 🧬 Update schema.prisma
Change the generator block to use the new prisma-client:
-generator client {
- provider = "prisma-client-js"
- previewFeatures = ["driverAdapters"]
- output = "../node_modules/.prisma/client"
+generator client {
+ provider = "prisma-client"
+ runtime = "workerd"
+ moduleFormat = "esm"
+ generatedFileExtension = "ts"
+ importFileExtension = "ts"
+ output = "../generated/prisma"
+ previewFeatures = ["queryCompiler", "driverAdapters"]
}
3. 🗂️ Adjust TypeScript Paths
In tsconfig.json:
- ".prisma/*": ["./node_modules/.prisma/*"]
+"@/*": ["./src/*"],
+ "@generated/*": ["./generated/*"]
Then update imports from @prisma/client to @/db.
4. 🛠️ Refactor DB Client Usage
- Replace your
src/db.tswith the latest in the standard starter: https://github.com/redwoodjs/sdk/blob/main/starters/standard/src/db.ts - Make sure you are importing and calling
setupDb()in yourworker.tsx:
5. 📁 Add to .gitignore
+generated/
6. 📦 Re-generate Client
After updating schema.prisma:
npx prisma generate
7. 🧪 Test Everything
Check your queries work in development and deployments.
⚠️ Trouble with @prisma/client import?
If you're seeing an error like this:
✘ [ERROR] Import "/path/to/project/@prisma/client/runtime/query_engine_bg.sqlite.wasm" not found. Does the file exist? [plugin vite:dep-scan]
generated/prisma/internal/class.ts:80:6:
80 │ "@prisma/client/runtime/query_engine_bg.sqlite.wasm"
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
…it may be due to having "baseUrl" set in tsconfig.json, which causes Vite to resolve @prisma/client via the @/* alias.
✅ Fix it by overriding the alias in vite.config.mts:
import path from "path";
export default defineConfig({
resolve: {
alias: {
"@prisma/client": path.resolve(
__dirname,
"node_modules",
"@prisma",
"client"
),
},
},
});More details on the problem and solution can be found here: emelleby/ilca-kns#1