What is the feature you are proposing?
I have successfully updated my vite.config.ts file to work with Cloudflare D1 and Prisma.
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?
What is the feature you are proposing?
I have successfully updated my
vite.config.tsfile 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?