Tanstack start wrangle dev cloudflare worker
@VickyCena want to test wrangler dev in local in miniflare. After doing build, I am getting a issue on react dom server on running wrangler dev, It is working fine by running vinxi dev, Can someone help me who are familiar with wrangler and cloudflare deployments
X [ERROR] Could not resolve "react-dom/server"
.output/server/chunks/build/report-DwJEuG7y.mjs:25:7:
25 │ import 'react-dom/server';
╵ ~~
The module "./server.edge.js" was not found on the file system:
.output/server/node_modules/react-dom/package.json:59:17:
59 │ "workerd": "./server.edge.js",
╵
You can mark the path "react-dom/server" as external to exclude it from the bundle, which will
remove this error and leave the unresolved path in the bundle.
X [ERROR] Could not resolve "react-dom/server"
.output/server/index.mjs:24:7:
24 │ import 'react-dom/server';
╵
The module "./server.edge.js" was not found on the file system:
.output/server/node_modules/react-dom/package.json:59:17:
59 │ "workerd": "./server.edge.js",
╵ ~~
You can mark the path "react-dom/server" as external to exclude it from the bundle, which will
remove this error and leave the unresolved path in the bundle.
X [ERROR] Could not resolve "#crypto"
.output/server/node_modules/@clerk/backend/dist/chunk-2Z4IRG2E.mjs:8:36:
8 │ import { webcrypto as crypto } from "#crypto";
3 Replies
absent-sapphire•4mo ago
Are you on the alpha branch or the main branch?
fascinating-indigo•4mo ago
main branch only
absent-sapphire•4mo ago
add to app.config.ts
vite: {
resolve: {
// Use react-dom/server.edge instead of react-dom/server.browser for React 19.
// Without this, MessageChannel from node:worker_threads needs to be polyfilled.
alias: import.meta.env.PROD && {
"react-dom/server": "react-dom/server.edge",
},
},