Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nuxi generate does not create .output directory anymore #32

Closed
dargmuesli opened this issue Apr 12, 2022 · 8 comments · Fixed by #324
Closed

nuxi generate does not create .output directory anymore #32

dargmuesli opened this issue Apr 12, 2022 · 8 comments · Fixed by #324
Assignees
Labels
bridge bug Something isn't working ❗ p4-important

Comments

@dargmuesli
Copy link
Member

dargmuesli commented Apr 12, 2022

Environment

  • Nuxt version: 2.16.0-27358576.777a4b7f
  • @nuxt/bridge version: 3.0.0-27495976.e31c604
  • nitropack version: 0.2.5

Reproduction

As the linked, simple renovate-PR highlights the issue, I don't think another repro is needed. If it is, feel free to tell me.

Describe the bug

After upgrading @nuxt/bridge I receive the error FATAL [nitro] Please use nuxt generate for static target, which I (kinda) already do (nuxi generate).
Later on in the same build I now receive a webpack error originating from @nuxt/bridge, which I can "fix" by adding @nuxt/bridge to the build.transpile array.
After doing so tough, there is no .output directory created anymore.

Additional context

Sounds similar to nuxt/nuxt#13708.

Logs

https://github.com/dargmuesli/jonas-thelemann/runs/5992266520
@danielroe
Copy link
Member

related: #31

@danielroe danielroe transferred this issue from nuxt/framework Apr 13, 2022
@jegardiner
Copy link

I'm also having this problem, although I've not added @nuxt/bridge to the build.transpile array.

nuxi generate does not create the .ouput folder, despite mentioning it in it's success message:

✔ You can now deploy .output/public to any static hosting!

I can use nuxt generate, which outputs to the dist folder as a workaround for now.

@danielroe danielroe self-assigned this May 1, 2022
@danielroe danielroe added bug Something isn't working ❗ p4-important and removed pending triage labels May 1, 2022
@danielroe danielroe mentioned this issue May 1, 2022
10 tasks
@roseMix
Copy link

roseMix commented May 8, 2022

@jegardiner I was able to to use nuxt generate but only after adding "nuxt": "npm:nuxt-edge" to my package.json.

@danielroe is this intended behavior?

@dargmuesli
Copy link
Member Author

The dist directory with nuxt generate does not contain the same files as the .output does with nuxi generate. My intention is to keep all files directly deployable to a static file hoster / nginx with nuxi, while what nuxt/dist gives me is a "server and client" output.

@roseMix
Copy link

roseMix commented May 9, 2022

@dargmuesli hmm did you set target: 'static' in nuxt.config.js? You're output in dist should then be uploadable to any static host.

BTW This is just a temporary workaround using the old nuxt command line. Hopefully once nuxt/framework#324 lands we'll be able to use the new nuxi command.

@dargmuesli
Copy link
Member Author

Yes, I have target set to static.

@roseMix
Copy link

roseMix commented May 9, 2022

Rereading your question, for this workaround to work you need to change your package.json to "generate": "nuxt generate" using the old nuxt command.

Leaving it at nuxi generate tries to output the .output directory and fails because of the bug.

You might also need to add "nuxt": "npm:nuxt-edge" to devDependencies if you get errors about nuxt not being defined.

BTW as an aside, the Bridge Docs say to put the nuxi generate as the script for build not under generate not sure why.

@dargmuesli
Copy link
Member Author

put the nuxi generate as the script for build not under generate not sure why.

I guess build is kind of the standard and for generated projects building is equivalent to generating.

danielroe added a commit that referenced this issue Jul 8, 2022
BREAKING CHANGE: `nuxi generate` now behaves differently using nitro prerendering instead of the Nuxt 2 full-static approach. If you would like to keep the Nuxt 2 generation logic while still using nitro, you can run `nuxi generate --classic` or set `bridge.nitroGenerator` to `false`.

resolves #322, resolves #31, resolves #32, resolves #375, resolves #356
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bridge bug Something isn't working ❗ p4-important
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants