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.

dev server is not using port from options

See original GitHub issue

Environment

nuxi dev

“nuxt-edge”: “^2.16.0-27226092.034b9901” “@nuxt/bridge”: “npm:@nuxt/bridge-edge

Describe the bug and expected behavior

I provided server host and port (8080) but nuxt opens server on still localhost:3000 (other options (head, proxy or i18n) is working fine)

Steps to reproduce

// nuxt.config.ts
import { defineNuxtConfig } from "@nuxt/bridge";

export default defineNuxtConfig({
        ...
	server: {
		host: "0.0.0.0",
		port: 8080,
	},
        ...
});

then

Nuxt CLI v3.0.0-27234503.d5127e9                                                                                                                                                                       16:15:14
                                                                                                                                                                                                       16:15:14
  > Local:    http://localhost:3000/
  > Network:  http://172.25.240.1:3000/
  > Network:  http://192.168.1.2:3000/

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:6
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
mattgilbertnetcommented, Oct 31, 2022

I see. With nuxi, we start listening outside of nuxt context so cannot rely on options.server that is loaded with nuxt instance. For bridge, you can keep using nuxt dev (instead of nuxi dev) that supports options. I also created #933 to keep track for supporting socket and other listening options.

For me, both nuxi dev and nuxt dev default to 3000 if bridge is installed, ignoring options. (I don’t think this issue should be closed.)

1reaction
fabis94commented, Apr 13, 2022

@pi0 There should be a way to load these settings from a config/env file at the very least. Are there any plans to implement this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is there a way to let webpack dev server use another port?
So on local development, I open localhost:8080, which forwards all requests to localhost:8084 which is the webpack server. However, that service ...
Read more >
webpack-dev-server
Just navigate the browser to http://<host>:<port>/webpack-dev-server/<path> . I. e. with the above configuration http://localhost:8080/webpack-dev-server/index.
Read more >
DevServer - webpack
If you're using dev-server through the Node.js API, the options in devServer will be ignored. Pass the options as the first parameter instead:...
Read more >
webpack-dev-server - npm.io
Usage: webpack serve|server|s [entries...] [options] Run the webpack dev server. Options: -c, --config <value...> Provide path to a webpack configuration file ...
Read more >
Configuration Reference | Vue CLI
To use the iframe mode no additional configuration is needed. Just navigate the browser to http://<host>:<port>/webpack-dev-server/<path> to ...
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