question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

change vite.server.port not work

See original GitHub issue

Environment

Nuxt project info: 18:48:43


  • Operating System: Darwin
  • Node Version: v16.17.0
  • Nuxt Version: 3.0.0-rc.9
  • Nitro Version: 0.5.1
  • Package Manager: npm@8.15.0
  • Builder: vite
  • User Config: alias, ssr, vite
  • Runtime Modules: -
  • Build Modules: -

Reproduction

  1. git clone https://github.com/4tst/nuxt3-starter.git
  2. change nuxt.config.ts, set vite.server.port=3001
  3. npm run dev

Describe the bug

always use port 3000 & _nuxt (hmr.path)

Additional context

No response

Logs

No response

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
xdewxcommented, Sep 7, 2022

Currently, it is possible to use PORT=3001 nuxt dev or nuxt dev --port 3001 to set them.

ok, thank you very much. and I would suggest adding more documents at v3.nuxtjs.org, maybe include the below:

  1. the principles of nuxt3
  2. the relationship among nuxt & vite & nitro
1reaction
pi0commented, Sep 7, 2022

Hi @whichdew. Yes this is expected. Nuxt lunches it’s own server and this type is not picked.

Note: (i think we should fix types to disallow using this option)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Server Options - Vite
Specify server port. Note if the port is already being used, Vite will automatically try the next available port so this may not...
Read more >
vite doesn't respect new port in config file · Issue #6074 - GitHub
Describe the bug When you change server.port in config, vite just restart server but does not use new port Reproduction import ...
Read more >
Run the Vite dev server on a custom port - Koen Woortman
The Vite dev server starts by default on network port 3000. We can specify a different port if we prefer to.
Read more >
How to Change vite application port - reactjs - Stack Overflow
Try add your port into vite.config.ts: export default defineConfig({ // ...some configs server: { port: 3006, }, });.
Read more >
Vite Configuration - AEM Vite
By default Vite will attempt to start the server on port 3000 but will automatically increment to the next available port if 3000...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found