ng serve --disable-host-check no longer works
See original GitHub issueVersions
CLI: 1.6.7
node: 8.9.4
npm: 5.6.0
typescript: 2.6.2
OS: Debian 9.3
Repro steps
ng serve --host '0.0.0.0' --port 42002 --public-host 'localhost:42002' --disable-host-check
- Open http://HostnameOfServer:42002 on a different device
Observed behavior
Request host is not whitelist enabled for this server. Please use the --host command-line flag to whitelist a specific host (recommended) or use --enable_host_checking to disable host checking. See the command-line flags help text for more information.
Desired behavior
Site should load successfully.
Mention any other details that might be useful (optional)
This used to work, but I’m not sure of the version at which it stopped working.
--host '0.0.0.0'
is needed while running the CLI in Docker because otherwise it dies with:
getaddrinfo ENOTFOUND '0.0.0.0'
Error: getaddrinfo ENOTFOUND '0.0.0.0'
at errnoException (dns.js:50:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
"Invalid Host header" when running Angular/cli ...
The --disable-host-check flag works fine if you need to run from Cloud9. I use the following command: ng serve --open --host $IP --port ......
Read more >ng serve
Option Description Value Type Default Value
‑‑hmr Enable hot module replacement. boolean false
‑‑host Host to listen on. string localhost
‑‑open Opens the url in default...
Read more >What does disableHostCheck in package.json exactly do?
The webpack dev server checks the host header to see if it aligns with the "allowedHosts" array. If the host is not present,...
Read more >ng serve - Angular
Builds and serves your app, rebuilding on file changes. ng serve < project > [ options ]. ng serve < project > [...
Read more >Rework Your Angular Development Workflow
The next step is to get NGINX working with Angular. ... The ng build command is different than ng serve because no development...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
using double quotemarks worked for me:
--host "0.0.0.0"
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.