Weird thing is that If depending on how I run npm script it may work or not
//package.json
"scripts": {
"dev": "vite --config vite-client.config.ts --port 3000 dev",
"build": "npm run build:client && npm run build:server",
"build:client": "vite build --outDir --config vite-client.config.ts dist/static",
"build:server": "vite build --ssr src/entry-server.tsx --config vite-server.config.ts --outDir dist/server",
"generate": "vite build --config vite-client.config.ts --outDir dist/static && npm run build:server && node prerender"
},
So If I do yarn run build:client then yarn run build:server It's working, yarn run generate gives the above error