N
Nuxt12mo ago
Spunkie

`npx nuxi generate` sometimes builds to .output/public and other times to .dist?

I'm using the latest nuxt on cloudflare pages but my builds are failing sometimes because of the differing output dir. I don't really understand what is causing the difference in behavior. I'm following the nuxt docs on deployment so on CF pages I'm running npx nuxi generate and looking for the build dir of .output/public. I've also tried with node 16 and 18 but it doesn't fix the issue. Some branches are building, while others are not on CF. If I clone the branches with failed builds and run npx nuxi generate locally it builds to the correct .output/public dir. CF pages:
21:22:06.570 Executing user command: npx nuxi generate
21:22:08.238 [log] Nuxt 3.8.2 with Nitro 2.8.1
21:22:08.554 [info] Using Nitro server preset: `static`
...
21:22:37.971 [success] [nitro] Generated public dist
21:22:38.013 [success] [nitro] You can preview this build using `npx wrangler pages dev dist`
21:22:38.014 [success] [nitro] You can deploy this build using `npx wrangler pages deploy dist`
21:22:38.014 [success] You can now deploy `dist` to any static hosting!
21:22:38.195 Finished
21:22:38.196 Note: No functions dir at /functions found. Skipping.
21:22:38.196 Validating asset output directory
21:22:38.196 Error: Output directory ".output/public" not found.
21:22:39.508 Failed: build output directory not found
21:22:06.570 Executing user command: npx nuxi generate
21:22:08.238 [log] Nuxt 3.8.2 with Nitro 2.8.1
21:22:08.554 [info] Using Nitro server preset: `static`
...
21:22:37.971 [success] [nitro] Generated public dist
21:22:38.013 [success] [nitro] You can preview this build using `npx wrangler pages dev dist`
21:22:38.014 [success] [nitro] You can deploy this build using `npx wrangler pages deploy dist`
21:22:38.014 [success] You can now deploy `dist` to any static hosting!
21:22:38.195 Finished
21:22:38.196 Note: No functions dir at /functions found. Skipping.
21:22:38.196 Validating asset output directory
21:22:38.196 Error: Output directory ".output/public" not found.
21:22:39.508 Failed: build output directory not found
Building same commit locally:
npx nuxi generate
Nuxt 3.8.2 with Nitro 2.8.1
ℹ Using Nitro server preset: static
ℹ Building client...
...
✔ Generated public .output/public
✔ You can preview this build using npx serve .output/public
✔ You can now deploy .output/public to any static hosting!
npx nuxi generate
Nuxt 3.8.2 with Nitro 2.8.1
ℹ Using Nitro server preset: static
ℹ Building client...
...
✔ Generated public .output/public
✔ You can preview this build using npx serve .output/public
✔ You can now deploy .output/public to any static hosting!
1 Reply
meltymelts
meltymelts10mo ago
Did you ever figure out the answer to this issue? I am having the same problem at the moment. I built a VERY minimal nuxt site and that one built and deployed just fine, even though I just went with the preset /dist output file location. Trying to load my real site is giving me the same Error: Output directory ".output/public" Failed: build output directory not found no matter which directory I specify.
Want results from more Discord servers?
Add your server