T
TanStackโ€ข2mo ago
correct-apricot

TanStack Start + Prisma edge + Cloudflare Worker fails during deployment

I am trying to deploy to Cloudfare Workers but getting the following reponse when visiting the deployed site:
{"status":500,"unhandled":true,"message":"HTTPError"}
{"status":500,"unhandled":true,"message":"HTTPError"}
Seeing this error on the Cloudflare worker side:
HTTPError: No such module "assets/.prisma/client/edge".
imported from "assets/db-boN08oha.js"Caused by: Error: No such module "assets/.prisma/client/edge".
imported from "assets/db-boN08oha.js"
HTTPError: No such module "assets/.prisma/client/edge".
imported from "assets/db-boN08oha.js"Caused by: Error: No such module "assets/.prisma/client/edge".
imported from "assets/db-boN08oha.js"
and also during the build, see this in the logs:
...
โœ“ built in 4.36s
00:42:17.792 vite v7.1.9 building SSR bundle for production...
00:42:17.797 transforming...
00:42:21.776 ".prisma/client/edge" is imported by ".prisma/client/edge?commonjs-external", but could not be resolved โ€“ treating it as an external dependency.
00:42:27.800 โœ“ 3819 modules transformed.
...
...
โœ“ built in 4.36s
00:42:17.792 vite v7.1.9 building SSR bundle for production...
00:42:17.797 transforming...
00:42:21.776 ".prisma/client/edge" is imported by ".prisma/client/edge?commonjs-external", but could not be resolved โ€“ treating it as an external dependency.
00:42:27.800 โœ“ 3819 modules transformed.
...
building on the Cloudflare side with:
"build": "npx prisma generate --no-engine && vite build"
"build": "npx prisma generate --no-engine && vite build"
Any suggestions on whats going on would be great ๐Ÿ™‚
7 Replies
correct-apricot
correct-apricotOPโ€ข2mo ago
schema.prisma:
generator client {
provider = "prisma-client-js"
}

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
}

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
vite config:
import { defineConfig } from 'vite'
import { tanstackStart } from '@tanstack/react-start/plugin/vite'
import viteReact from '@vitejs/plugin-react'
import viteTsConfigPaths from 'vite-tsconfig-paths'
import tailwindcss from '@tailwindcss/vite'
import { cloudflare } from '@cloudflare/vite-plugin'

const config = defineConfig({
plugins: [
cloudflare({ viteEnvironment: { name: 'ssr' } }),
// this is the plugin that enables path aliases
viteTsConfigPaths({
projects: ['./tsconfig.json'],
}),
tailwindcss(),
tanstackStart(),
viteReact(),
],
server: {
allowedHosts: [
],
},
})

export default config
import { defineConfig } from 'vite'
import { tanstackStart } from '@tanstack/react-start/plugin/vite'
import viteReact from '@vitejs/plugin-react'
import viteTsConfigPaths from 'vite-tsconfig-paths'
import tailwindcss from '@tailwindcss/vite'
import { cloudflare } from '@cloudflare/vite-plugin'

const config = defineConfig({
plugins: [
cloudflare({ viteEnvironment: { name: 'ssr' } }),
// this is the plugin that enables path aliases
viteTsConfigPaths({
projects: ['./tsconfig.json'],
}),
tailwindcss(),
tanstackStart(),
viteReact(),
],
server: {
allowedHosts: [
],
},
})

export default config
exotic-emerald
exotic-emeraldโ€ข2mo ago
can you please create an issue here? https://github.com/cloudflare/workers-sdk
GitHub
GitHub - cloudflare/workers-sdk: โ›…๏ธ Home to Wrangler, the CLI f...
โ›…๏ธ Home to Wrangler, the CLI for Cloudflare Workersยฎ - cloudflare/workers-sdk
correct-apricot
correct-apricotOPโ€ข2mo ago
GitHub
TanStack Start + Prisma edge + Cloudflare Worker fails after deploy...
What versions & operating system are you using? System: OS: macOS 15.6.1 CPU: (14) arm64 Apple M4 Max Memory: 103.16 MB / 36.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 24.1.0 - /Users//.nvm/ve...
variable-lime
variable-limeโ€ข2mo ago
in their docs they recommend a different provider and also recommend accelerate. you could try
correct-apricot
correct-apricotOPโ€ข2mo ago
I am using everything the reccomend and still not working, when chaging to this, it crashes the local build with:
Error: No such module "node:os".
Error: No such module "node:os".
also, those docs seem outdated (still using vixi) is there no example of tanstack start using cloudflare + prisma? I see them seperately but seems like there is no clear way to do it together
exotic-emerald
exotic-emeraldโ€ข2mo ago
no there is no such example

Did you find this page helpful?