Cloudflare Pages: Error: Failed To Start Application

Hi guys,
I’ve used your tutorial to install Bolt on Cloudflare Pages (thanks a lot for this great piece of work).

Now I’m trying to run some code using both OpenRouter’s LLama and OpenAI models. Often it starts to fail already at the “npm install” or “npm run dev” installation commands. Showing no preview/only white screen and “jsh: command not found: vite” in the terminal.

~/project
❯ 

~/project
❯ **

npm run dev

**
jsh: command not found: **
jsh: command not found: **
… bquote ❯ jsh: Cannot read properties of undefined (reading 'exitCode')

… bquote ❯ jsh: Cannot read properties of undefined (reading 'exitCode')

… bquote ❯ npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /home/project/package.json
npm ERR! errno -2
npm ERR! enoent Could not read package.json: Error: ENOENT: no such file or directory, open '/home/project/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in: /home/.npm/_logs/2024-12-27T07_59_44_393Z-debug-0.log
jsh: spawn npm ENOENT
jsh: Cannot read properties of undefined (reading 'exitCode')

… bquote ❯ ^C**

node index.js

**


~/project
❯ **

node index.js

**
jsh: command not found: **
jsh: command not found: **
… bquote ❯ jsh: Cannot read properties of undefined (reading 'exitCode')

… bquote ❯ jsh: Cannot read properties of undefined (reading 'exitCode')

… bquote ❯ Error: Cannot find module '/home/project/index.js'
    at Module._resolveFilename (https://5q2t0wfrddrsj5uwypj5hp01on61wc-tjfj.w-corp-staticblitz.com/builtins.ddb8d84d.js:144:12334)
    at Module._load (https://5q2t0wfrddrsj5uwypj5hp01on61wc-tjfj.w-corp-staticblitz.com/builtins.ddb8d84d.js:144:9839)
    at Function.executeUserEntryPoint [as runMain] (https://5q2t0wfrddrsj5uwypj5hp01on61wc-tjfj.w-corp-staticblitz.com/builtins.ddb8d84d.js:165:1641)
    at internal/main/run_main_module (https://5q2t0wfrddrsj5uwypj5hp01on61wc-tjfj.w-corp-staticblitz.com/builtins.ddb8d84d.js:138:398)
    at _0x20d812 (https://5q2t0wfrddrsj5uwypj5hp01on61wc-tjfj.w-corp-staticblitz.com/blitz.c8c182a3.js:40:1435001)
    at _0x4b47f4.executeBootstrapper (https://5q2t0wfrddrsj5uwypj5hp01on61wc-tjfj.w-corp-staticblitz.com/blitz.c8c182a3.js:40:898684)
    at _0x37b8f6.startExecution (https://5q2t0wfrddrsj5uwypj5hp01on61wc-tjfj.w-corp-staticblitz.com/blitz.c8c182a3.js:40:1466615)
    at _0x37b8f6.run (https://5q2t0wfrddrsj5uwypj5hp01on61wc-tjfj.w-corp-staticblitz.com/blitz.c8c182a3.js:40:1465299) {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v18.20.3
jsh: Cannot read properties of undefined (reading 'exitCode')

… bquote ❯ 
~/project
❯ 

~/project
❯ npm run dev

> meal-vitamin-analyzer@0.0.0 dev
> vite

jsh: command not found: vite

~/project
❯ 

~/project
❯ npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: meal-vitamin-analyzer@0.0.0
npm ERR! Found: react@18.3.1
npm ERR! node_modules/react
npm ERR!   react@"^18.2.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.0 || ^17.0.0" from react-chartjs-2@3.3.0
npm ERR! node_modules/react-chartjs-2
npm ERR!   react-chartjs-2@"^3.0.4" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! 
npm ERR! For a full report see:
npm ERR! /home/.npm/_logs/2024-12-27T08_18_06_056Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: /home/.npm/_logs/2024-12-27T08_18_06_056Z-debug-0.log

~/project
❯ 

~/project
❯ npm run dev

> meal-vitamin-analyzer@0.0.0 dev
> vite

jsh: command not found: vite

~/project
❯ 

~/project
❯ npm run dev

> meal-vitamin-analyzer@0.0.0 dev
> vite

jsh: command not found: vite

~/project
❯ 

~/project
❯ npm install --save-dev vite
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: meal-vitamin-analyzer@0.0.0
npm ERR! Found: react@18.3.1
npm ERR! node_modules/react
npm ERR!   react@"^18.2.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.0 || ^17.0.0" from react-chartjs-2@3.3.0
npm ERR! node_modules/react-chartjs-2
npm ERR!   react-chartjs-2@"^3.0.4" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! 
npm ERR! For a full report see:
npm ERR! /home/.npm/_logs/2024-12-27T08_18_10_583Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: /home/.npm/_logs/2024-12-27T08_18_10_583Z-debug-0.log

~/project
❯ 

~/project
❯ npm run dev

> meal-vitamin-analyzer@0.0.0 dev
> vite

jsh: command not found: vite

~/project
❯ 
  • also in most cases the code is only being shown in the chat (in the left sidebar) and no files or actual code is being generated

HI @seblosiv,

please try a bigger model. Start with some that are known to work fine as described in the FAQ/Docs:

https://stackblitz-labs.github.io/bolt.diy/FAQ/

Start from a new chat!

1 Like

I haven’t had much luck with any of the “free” models for Openrouter. If you want to use that one, you can find it through HuggingFace for free (I’d use a 70B+ model), or get Google Gemini 2.0 Flash (exp-1219) through Google AI Studio also for free, which is way better and appears to have no limits or cap!

1 Like