Getting error deploying Cloudflare worker
I am using tanstack start version
here is my
Here is my
Getting error while running
Am I missing something, or does anyone have the same problem? Help me, please.
1.121.261.121.26 Vite pluginhere is my
vite.conf.tsvite.conf.tsimport { tanstackStart } from '@tanstack/react-start/plugin/vite'
import tailwindcss from "@tailwindcss/vite";
import { defineConfig } from 'vite'
import tsConfigPaths from 'vite-tsconfig-paths'
export default defineConfig({
server: {
port: 3000,
},
plugins: [
tsConfigPaths({
projects: ['./tsconfig.json'],
}),
tanstackStart({
target: "cloudflare-worker"
}),
tailwindcss(),
],
})import { tanstackStart } from '@tanstack/react-start/plugin/vite'
import tailwindcss from "@tailwindcss/vite";
import { defineConfig } from 'vite'
import tsConfigPaths from 'vite-tsconfig-paths'
export default defineConfig({
server: {
port: 3000,
},
plugins: [
tsConfigPaths({
projects: ['./tsconfig.json'],
}),
tanstackStart({
target: "cloudflare-worker"
}),
tailwindcss(),
],
})Here is my
wrangler.jsoncwrangler.jsonc{
"$schema": "node_modules/wrangler/config-schema.json",
"name": "nasimdev",
"main": "./.output/server/index.mjs",
"compatibility_date": "2025-04-14",
"observability": {
"enabled": true
},
"assets": {
"directory": "./.output/public/"
},
"compatibility_flags": [
"nodejs_compat"
]
}{
"$schema": "node_modules/wrangler/config-schema.json",
"name": "nasimdev",
"main": "./.output/server/index.mjs",
"compatibility_date": "2025-04-14",
"observability": {
"enabled": true
},
"assets": {
"directory": "./.output/public/"
},
"compatibility_flags": [
"nodejs_compat"
]
}Getting error while running
npx wrangler deploynpx wrangler deploy✘ [ERROR] Build failed with 1 error:
✘ [ERROR] Unexpected external import of "node:events",
"node:perf_hooks", "node:stream", and "node:tty".
Your worker has no default export, which means it is assumed to be a Service Worker format Worker.
Did you mean to create a ES Module format Worker?
If so, try adding `export default { ... }` in your entry-point.
See https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/.
[plugin hybrid-nodejs_compat]✘ [ERROR] Build failed with 1 error:
✘ [ERROR] Unexpected external import of "node:events",
"node:perf_hooks", "node:stream", and "node:tty".
Your worker has no default export, which means it is assumed to be a Service Worker format Worker.
Did you mean to create a ES Module format Worker?
If so, try adding `export default { ... }` in your entry-point.
See https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/.
[plugin hybrid-nodejs_compat]Am I missing something, or does anyone have the same problem? Help me, please.