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 start missing as a part of command cli in v3.7 #113

Closed
Q16solver opened this issue Aug 29, 2023 · 12 comments · Fixed by #124
Closed

nuxi start missing as a part of command cli in v3.7 #113

Q16solver opened this issue Aug 29, 2023 · 12 comments · Fixed by #124
Labels
enhancement New feature or request

Comments

@Q16solver
Copy link

In the previous versions of nuxt, I was using nuxt start to start my production server, though I did later find out it's just an alias to nuxt preview after looking at the source code. It is convenient to have this alias though, could we add this back?

@pi0 pi0 added the enhancement New feature or request label Aug 29, 2023
Copy link
Member

I would highly recommend not to use this command to start your production server, in any case. It means you would have to have all your development dependencies installed.

Running node .output/server/index.mjs is much more lightweight.

@atinux atinux closed this as not planned Won't fix, can't repro, duplicate, stale Aug 29, 2023
@pi0
Copy link
Member

pi0 commented Aug 29, 2023

I would recommend the same but this is a breaking change and i believe we should keep alias with a warning till next major version.

@pi0 pi0 reopened this Aug 29, 2023
@Q16solver
Copy link
Author

Q16solver commented Aug 29, 2023

Sure, that makes sense, but normally “start” has conventionally meant starting a production server afaik, perhaps it can just be an alias to node .output/… in the next major version
what’s stopping us from doing that?
It’s more convenient for the user and follows same structure as other tools like vue cli from before, if we need to specify the runtime as a nuxt.config thing, I don’t really mind that either imo

Copy link
Member

danielroe commented Aug 30, 2023

Yes, it does just run that command, alongside loading .env and a couple other things. The issue is that then you still have to have nuxi itself installed.

More important, I think, is that ideally you shouldn't have your other dev dependencies installed. There will be many unnecessary megabytes there.

@LuXDAmore
Copy link

@danielroe What about the SPA building?

You can preview this build using npx serve src/.output/public
HTML content not prerendered because ssr: false was set

We can't run the command node src/.output/server/index.mjs

I think nuxi start could be useful also for this use case:
one command to make it more clear and easy to run. No?

@pi0
Copy link
Member

pi0 commented Aug 30, 2023

I am probably speaking ahead of myself and our plans but yes, there might be benefits of supporting (standalone) nuxi binary for production deployment lunching.

nuxi is currently not intended to be and we might end up having something more compact for that (as part of nitro self-hosting deployment bundle improvement plans).

For now, please consider directly uploading .output directory to your production environments and not rely on main project (dev) dependencies and start command.

@LuXDAmore
Copy link

For now, please consider directly uploading .output directory to your production environments and not rely on main project (dev) dependencies and start command.

@pi0 In our project we're using nuxi start ./src to run some e2e test on the local machine with Playwright, so it's very useful.

Now i've fixed it with:

  • "start": "npx serve src/.output/public" // package.json
  • { webServer: { command: 'yarn start' } } // playwright.config

but like this we need to have installed npx globally (i know it's installed by default but with the command nuxi start everything was already "inside" the project with npm/yarn).

Just, having one command to manage both ssr and spa modes it's also something i can bring on every project.

I am probably speaking ahead of myself and our plans

But yes ok, i can understand your plans 😄

@pi0
Copy link
Member

pi0 commented Aug 30, 2023

Thanks for sharing your usecases @LuXDAmore it definitely helps to make decition about start command 👍🏼

@dword-design
Copy link

dword-design commented Aug 30, 2023

I still don't understand why this has been dropped in a non-major version. There are recommendations and there is semantic versioning 🙂.

@danielroe
Copy link
Member

It was a mistake and has already been reverted.

@dword-design
Copy link

Alright, can it be deployed to npm? 😊

@danielroe
Copy link
Member

It is. You can already try it out with nuxi-edge, before a formal release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants