Skip to content
This repository has been archived by the owner on Feb 15, 2025. It is now read-only.

devServer.port is ignored in config #423

Closed
kirill-konshin opened this issue Jan 26, 2018 · 5 comments
Closed

devServer.port is ignored in config #423

kirill-konshin opened this issue Jan 26, 2018 · 5 comments

Comments

@kirill-konshin
Copy link

This issue is a: Bug report

On latest NWB if config exports the following the port is still 3000:

module.exports.devServer = {
    port: '8080'
};

Based on following docs it should work: https://github.com/insin/nwb/blob/master/docs/Configuration.md#dev-server-configuration and https://webpack.js.org/configuration/dev-server/#devserver

Is there any other way to configure port from JS?

@insin
Copy link
Owner

insin commented Jan 26, 2018

Some of the devServer options are only used by webpack-dev-server's CLI, which nwb isn't using, so you currently you have to pass a --port option to the nwb serve command instead.

devServer config is available when nwb is starting the server, so we can can also add support for using devServer.port if it's configured.

@kirill-konshin
Copy link
Author

Yes of course I am aware of —port CLI param, but it’s not always convenient. It would be great if config will be respected )

@insin insin closed this as completed in 6a5ba9a Jan 26, 2018
@kirill-konshin
Copy link
Author

Wow that was fast! Thanks! When to expect NPM release?

@insin
Copy link
Owner

insin commented Jan 27, 2018

Should be later today, there are some dependency updates I want to include as well.

@kirill-konshin
Copy link
Author

Found a weirdest bug on version 0.21.3.

When I run with exports.devServer.port = '8080' I get:

Something is already running on port 8080.
? Would you like to run the app on another port instead? (Y/n) 

Notice that port 8080 is in the message. I double checked http://localhost:8080 and $ lsof -i tcp:8080 — there's nothing running.

But when I do nwb serve-react-app --port 8080 everything just works even without changing the config :) how weird...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants