✘ [ERROR] Build failed with 3 errors:
✘ [ERROR] Could not resolve "unenv/node/console"
node_modules/@cloudflare/unenv-preset/dist/runtime/node/console.mjs:9:7:
9 │ } from "unenv/node/console";
╵ ~~~~.
✘ [ERROR] Could not resolve
"unenv/node/internal/process/hrtime"
node_modules/@cloudflare/unenv-preset/dist/runtime/node/process.mjs:1:38:
1 │ ... hrtime as UnenvHrTime } from "unenv/node/
✘ [ERROR] Could not resolve
"unenv/node/internal/process/process"
node_modules/@cloudflare/unenv-preset/dist/runtime/node/process.mjs:2:40:
2 │ ...ocess as UnenvProcess } from "unenv/node/internal/process/process";
╵
Above is the error I’m getting when I run npm run deploy
The build finish fine without errors but the error shows up when it tries to deploy to workers
my wrangler.json
{
"$schema": "node_modules/wrangler/config-schema.json",
"name": "autotok",
"compatibility_date": "2025-09-02",
"compatibility_flags": ["nodejs_compat"],
"main": "./dist/server/server.js"
}
Yes I have deleted node modules package lock try again still the same issue
Here my vite.config.ts
// vite.config.ts
import { defineConfig } from 'vite'
import { tanstackStart } from '@tanstack/react-start/plugin/vite'
import viteReact from '@vitejs/plugin-react'
import tsconfigPaths from 'vite-tsconfig-paths'
import tailwindcss from '@tailwindcss/vite'
export default defineConfig({
server: {
port: 3000,
},
plugins: [
tailwindcss(),
// Enables Vite to resolve imports using path aliases.
tsconfigPaths(),
tanstackStart({
srcDirectory: 'src', // This is the default
router: {
// Specifies the directory TanStack Router uses for your routes.
routesDirectory: 'app', // Defaults to "routes", relative to srcDirectory
},
}),
viteReact(),
],
})
Help please