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

Incorrect preview command in nitro.json when output.publicDir option is set #2948

Open
alSergey opened this issue Dec 19, 2024 · 2 comments
Open
Labels
bug Something isn't working

Comments

@alSergey
Copy link

Environment

  • Node - v20.18.1
  • Npm - 10.8.2
  • Nitropack - 2.10.4

Reproduction

  1. Open Stackblitz
  2. Run npx nuxi generate
  3. Open dist/nitro.json

Describe the bug

Due to the fact that the command npx serve ./public is generated instead of npx serve ./, npx nuxi preview does not work correctly and the server does not start.

Is it possible to change preview command to npx serve ./ when output.publicDir option is set?

Additional context

No response

Logs

No response

@pi0 pi0 added bug Something isn't working and removed pending triage labels Dec 19, 2024
@gioboa
Copy link
Contributor

gioboa commented Jan 18, 2025

So if I understand correctly to fix this issue we need to change the behaviour of npx nuxi preview and use ( in the command npx serve ) the output.publicDir if present .
Is it correct?

@alSergey
Copy link
Author

If I understood everything correctly, then the npx nuxi preview command runs the command that is written inside the nitro.json file. The command is currently written there without taking into account the output.publicDir setting.

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants