Deploying sveltekit monorepo

I am getting vite: command not found when trying to deploy a sveltekit site part of a bun monorepo. The build command used is bun run build.
2025-01-22T10:07:39.874Z Initializing build environment...
2025-01-22T10:07:49.391Z Success: Finished initializing build environment
2025-01-22T10:07:49.468Z Cloning repository...
2025-01-22T10:07:51.366Z Detected the following tools from environment: [email protected], [email protected]
2025-01-22T10:07:51.367Z Executing user build command: bun run build
2025-01-22T10:07:51.633Z $ vite build
2025-01-22T10:07:51.635Z /usr/bin/bash: line 1: vite: command not found
2025-01-22T10:07:51.639Z error: script "build" exited with code 127
2025-01-22T10:07:51.641Z Failed: error occurred while running build command
2025-01-22T10:07:39.874Z Initializing build environment...
2025-01-22T10:07:49.391Z Success: Finished initializing build environment
2025-01-22T10:07:49.468Z Cloning repository...
2025-01-22T10:07:51.366Z Detected the following tools from environment: [email protected], [email protected]
2025-01-22T10:07:51.367Z Executing user build command: bun run build
2025-01-22T10:07:51.633Z $ vite build
2025-01-22T10:07:51.635Z /usr/bin/bash: line 1: vite: command not found
2025-01-22T10:07:51.639Z error: script "build" exited with code 127
2025-01-22T10:07:51.641Z Failed: error occurred while running build command
Has anyone encountered this issue?
{
"name": "monorepo",
"version": "1.0.0",
"private": true,
"workspaces": [
"packages/*",
"apps/*"
]
}
{
"name": "monorepo",
"version": "1.0.0",
"private": true,
"workspaces": [
"packages/*",
"apps/*"
]
}
This is the monorepo package.json
11 Replies
apolodoro
apolodoroOP2mo ago
And this is the app package.json
Ahz
Ahz2mo ago
try running the build cmd locally to get more detail where why it failed
apolodoro
apolodoroOP2mo ago
It does not fail locally I can build and deploy to cloudflare locally the problem is when cloudflare has to run the build
Ahz
Ahz2mo ago
doesnt look like the install is happening for bun before the build
apolodoro
apolodoroOP2mo ago
Should i specify anything other than bun run build for the cloudflare build command?
Ahz
Ahz2mo ago
no idea, i dont use bun
apolodoro
apolodoroOP2mo ago
@DaniFoldi sorry for the ping but im not sure how to ask for help since no one from the team apparently saw this thread...
ab90..
ab90..2mo ago
I'm having the vite not found error too. builds locally but the cloudflare build fails. did you find a solution?
apolodoro
apolodoroOP2mo ago
Nope and no luck pinging...
ab90..
ab90..2mo ago
I got mine to work by changing NODE_ENV to "development" in my wrangler.json "vars": { "NODE_ENV": "development" }, Hope that helps! According to my friend ChatGPT: This forces Cloudflare to install devDependencies.
apolodoro
apolodoroOP5w ago
Uuuu I'll try right away

Did you find this page helpful?