Lovable export code won't run: bun install
Last verified:
The fix
Lovable export code won't run until you install with the lockfile in the folder. bun.lock means bun install, then the dev script. Do not add Next.js.
- 1
Install with the lockfile in the folder
bun.lockorbun.lockbmeansbun install, thenbun run dev.package-lock.jsonand no Bun lock meansnpm ci.pnpm-lock.yamlmeanspnpm install. Do not delete the lockfile. If the error names an engine, use Node.js 22 for a TanStack Start build.# bun.lock or bun.lockb in this folder bun install bun run dev # package-lock.json, and no bun lock npm ci npm run dev - 2
Run the dev script, not Next
Read
scripts.devinpackage.jsonand run that script. Ifdependencieslists@tanstack/react-start, you need that dev server. Openingindex.htmldoes not start it. Do not add Next sonext devexists, and do not change the dev script tonext dev. - 3
Separate a missing secret from a missing install
A missing module means the install did not finish.
supabaseUrl is requiredmeans the URL was empty when the client was created. A built-in backend export already hasVITE_SUPABASE_URLandVITE_SUPABASE_PUBLISHABLE_KEYin.env. Restart the dev server after you change.env. Do not put a service role or ansk_key in aVITE_variable. - 4
Prove the dev server, then stop
The dev script prints a local URL and that page loads. That is the export running. A push to the synced branch updates the Lovable preview after the sync card catches up. It does not publish, and it does not deploy an edge function or run a migration you added in git.
Why it happens
Download codebase and Git sync give you source, not node_modules. The zip is on paid plans: Download codebase at the bottom of the code editor file panel, or Project settings, then Git. On an Enterprise workspace, admins can limit that zip to admins and owners. Git sync is on every plan. Connecting it creates a new repository. You cannot point it at a repo you already have. After that, the synced branch goes both ways. Clone once the sync status card says both sides are on the same commit.
Lovable installs with Bun, so the folder has bun.lock (or bun.lockb on an older project). The hosting doc says the install command and the lockfile have to match. npm ci reads package-lock.json and cannot start without it. New projects from May 13, 2026 list @tanstack/react-start and need that dev server. Older projects are React + Vite. A TanStack Start production build wants Node.js 22. Secrets stored in Lovable are not in the zip or the repository.
The next error you'll probably hit
Once this is fixed, the usual follow-up is supabaseUrl is required. supabaseUrl is required: createClient got an empty URL or key, missing when the bundle was built. Set the Supabase URL and anon key, then rebuild.
Prompt to paste back into your AI tool
Paste this above the error.
The Lovable export code won't run on my machine. The lockfile in this folder is: <bun.lock, bun.lockb, package-lock.json, or pnpm-lock.yaml> The dev script in package.json is: <paste the dev script> The first error from install or from that script is: <paste the first error> Do not add Next.js. Do not delete the lockfile. Do not use --legacy-peer-deps unless you name the peer conflict. Do not put the Supabase service role or a Stripe secret in a VITE_ variable. Do not regenerate the project. 1. Install with the package manager that matches the lockfile. bun.lock means bun install. 2. Run the existing dev script. If @tanstack/react-start is a dependency, do not tell me to open index.html. 3. If a VITE_ name is missing, name it and tell me to put the public value in .env, then restart. Do not hardcode it. If .env already has VITE_SUPABASE_URL and the publishable key, leave them. 4. If the first error is ERESOLVE, a missing module, or supabaseUrl is required, fix only that. Leave working files unchanged.
Common questions
+It runs inside Lovable. Why does the same code fail after export?
The preview already has dependencies installed, and Lovable injects secrets that the zip and the repository do not contain. You install from the lockfile and start the dev script yourself. Connector and AI calls on a TanStack Start app can still fail on your machine.
+npm ci cannot find a package-lock, or npm run dev says it cannot find next. Did the export break?
npm ci needs package-lock.json. A Lovable folder with only bun.lock installs with bun install. Next is the wrong tool. Read scripts.dev. Do not add Next so the command you typed exists.
+Why won't my downloaded Lovable codebase run?
The zip is source only. It has no node_modules. Install with Bun when bun.lock is in the folder, then run the dev script. If the page boots and one request fails, the missing piece is a public env var or a redirect URL.
+Lovable export code won't run, and npm printed ERESOLVE. What now?
Stop on that install error. It names the dependency that does not match. Fix that pair. Do not delete the lockfile, and do not add --legacy-peer-deps before you have read the peer block.
Related errors
- supabaseUrl is requiredsupabaseUrl is required: createClient got an empty URL or key, missing when the bundle was built. Set the Supabase URL and anon key, then rebuild.CursorLovableBoltSupabaseNext.jsOct 19, 2026
- npm error ERESOLVE unable to resolve dependency treenpm error ERESOLVE unable to resolve dependency tree. Install a version whose peer matches this app. Do not start with --legacy-peer-deps.CursorLovableBoltNodeReactNov 4, 2026
- Lovable app not deploying: read the bannerLovable app not deploying: the Publish dialog says Build errors need fixing or Publishing failed. Match that sentence, fix that cause, and publish again.LovableCursorViteSupabaseNov 2, 2026
- Lovable GitHub sync not workingLovable GitHub sync not working: the sync status card or a Reconnect prompt says why. Fix that, on the branch the picker shows. Do not force-push the synced branch to make the two sides match.LovableCursorViteNodeOct 30, 2026
- No Output Directory named "dist" foundNo Output Directory named "dist" found after the Build completed. Vercel looked for a folder the build did not write. Set the framework preset to the app you actually build, or point Output Directory at the folder that exists.CursorLovableBoltVercelViteOct 27, 2026
- ReferenceError: process is not definedprocess is not defined in Vite, including Lovable and Bolt: browser code read process.env. Use import.meta.env.VITE_NAME and restart the dev server.CursorLovableBoltViteReactOct 16, 2026