Build works on "main" but fails on other branch

I have a Nuxt 3.14 project running in Vercel. Its been working fine but all of a sudden I get a build error.

Its weird because when I build the “main” branch its working fine, but when I try and build the same commit from a different branch, I get the build error:

[error] [nitro] Error: ENOENT: no such file or directory, realpath '/vercel/path0/node_modules/.pnpm/vue-router@4.3.2_vue@3.4.27/node_modules/vue'

What could cause this difference? Im not using any environment variables during build and “staging” and “main” are using the samme variables (“Preview”) any way.

I could try and debug the packages but that doesnt seem logic to do as its working on “main”.

Any clues what to do?

It could be a build cache issue. What happens if you redeploy with Use existing Build Cache left unchecked?

That seemed to work - is there a fix planned for this? I’ve spent really long time at debugging my own code.

The build team is always working to make deployments as easy as possible, so I shared your feedback with them. It’s a complex problem that I see most often after a project undergoes significant changes, like package upgrades or directory restructuring. There may not be a straightforward solution, but if anyone can solve this it will be them :smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.