Terezcath
Terezcath
NNuxt
Created by Terezcath on 2/24/2025 in #❓・help
How does nuxt build work, in depth?
I'm trying to use bazel to build a nuxt3 application and I'm getting stuck at the build. nuxt build/dev/generate etc all work fine and I can use the bazel equivalent of nuxt dev and I can also nuxt generate but when I try to have bazel build a full SSR app it fails with ERROR EACCES: permission denied, open '/home/user/.cache/bazel/_bazel_user/f2cab145d1e9274ddba8319b91b01062/sandbox/linux-sandbox/42/execroot/_main/bazel-out/k8-fastbuild/bin/contexts/project/.output/server/node_modules/@unhead/dom/package.json' In bazel the sandboxing does not allow you to both write files/directories and then read them within the same action and from the errors I'm seeing, that is what it looks like nuxt is doing. My build is succesfully building the .nuxt folder and gets to [nitro] ✔ Generated public .output/public [nitro] ℹ Building Nuxt Nitro server (preset: node-server, compatibility date: 2024-11-01) Before failing. Notably I can check the outputs and the .output/public and node_modules folders are both there and seem correct. I then have a few questions: 1. Is there a good reference for what nuxt is doing during build so I can better understand why it seems to access the node_modules under .output and not within the project directory 2. Are there any nuxt specific settings that would allow me to either reference node_modules externally from the command line, or to only do the copying first, and then do whatever else that is making it read the node_modules from .output (transpiling maybe?) 3. If anyone has experience with bazel anything that stands out to you that I am not doing.
5 replies