We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have successfully updated my vite.config.ts file to work with Cloudflare D1 and Prisma.
vite.config.ts
import build from "@hono/vite-build/cloudflare-workers"; import adapter from "@hono/vite-dev-server/cloudflare"; import honox from "honox/vite"; import { defineConfig } from "vite"; import { getPlatformProxy } from "wrangler"; export default defineConfig(async ({ command }) => { const platformProxy = command === "serve" ? await getPlatformProxy({ environment: "prod", configPath: "wrangler.json", }) : null; const devServerConfig = platformProxy ? { adapter: { env: platformProxy.env, onServerClose: platformProxy.dispose, }, } : { adapter, }; return { plugins: [ honox({ devServer: devServerConfig, }), build(), ], ssr: { external: [ "@prisma/adapter-d1", "@prisma/debug", "@prisma/driver-adapter-utils", "@prisma/client", "@auth/prisma-adapter", ], }, }; });
This works locally in development, but when I try to deploy to Cloudflare Workers I get an error:
✘ [ERROR] A request to the Cloudflare API (/accounts/b74ef356e795bbe93a6c96f17a1d0e37/workers/scripts/sutro-admin/versions) failed. Uncaught Error: No such module "@prisma/client". imported from "index.js" [code: 10021]
I've used D1 + Prisma + Hono + Cloudflare Workers successfully in the past. Is there a trick to getting Prisma to work with Vite/honox?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
What is the feature you are proposing?
I have successfully updated my
vite.config.ts
file to work with Cloudflare D1 and Prisma.This works locally in development, but when I try to deploy to Cloudflare Workers I get an error:
I've used D1 + Prisma + Hono + Cloudflare Workers successfully in the past. Is there a trick to getting Prisma to work with Vite/honox?
The text was updated successfully, but these errors were encountered: