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.

Typo/misleading docs re: webpack-dev-server

See original GitHub issue

Version

3.5.0

Reproduction link

https://gist.github.com/njwest/93922d4eddb9f440b57f0c68c209c1b9

Environment info

  System:
    OS: macOS 10.14.3
    CPU: (8) x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
  Binaries:
    Node: 8.10.0 - ~/.nvm/versions/node/v8.10.0/bin/node
    Yarn: 1.9.4 - /usr/local/bin/yarn
    npm: 6.4.1 - ~/.nvm/versions/node/v8.10.0/bin/npm
  Browsers:
    Chrome: 72.0.3626.121
    Firefox: 65.0.1
    Safari: 12.0.3
  npmGlobalPackages:
    @vue/cli: 3.5.0

Steps to reproduce

Run any Vue cli generated project with the devServer configuration linked above

What is expected?

Expect server spun up from npm run serve to shut down when stdin connection closes, as a result of stdin option on devServer.

What is actually happening?

Without this config, a server spun up continues running in the background after parent process shuts down stdin connection.

With this config, the following error is thrown:

options should NOT have additional properties
       
ValidationError: webpack Dev Server Invalid Options

The official Vue CLI doc (https://cli.vuejs.org/config/#devserver) says the following about the devServer configuration object:

All options for webpack-dev-server are supported.

Unfortunately this is incorrect, as devServer.stdin (which is CLI-only when running webpack-dev-server) is untouchable via this vue config object, which is problematic for vue-cli generated apps in environments in which a node server is expected to shut down when stdin closes.

Loving Vue CLI, but the lack of a clear way to set this standard stdin behavior disadvantages it vs. straight webpack deployments in certain environments

Thanks for the great software!

related to #1597

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
njwestcommented, Mar 10, 2019

The misleading part is that it says “All options are supported” with a link to the page containing CLI-only options in a section of the docs that is directly accessible via link – from accessing this via search, I wouldn’t know that it was referring to all options possible in the object file, I would think it was referring to all options in the page linked

This is really part of a larger issue of either not having a clear way to pass CLI flags to webpack-dev-server through vue config, or not having a way to pass standard options to webpack-dev-server other than CLI

0reactions
igorer88commented, Aug 19, 2019

Its being read as a boolean type, launching the default one not any other. Passing true or a string is the same, not the browsers as such. The only way I manage to launch a different browser is with a BROWSER env variable + the open option. It works fine for just one browser, but not for more than one. I like Firefox developer for CSS and Vivaldi for JS. And I look how it behaves in both. In gulp it was as easy as just passing an array with the browsers.

Read more comments on GitHub >

github_iconTop Results From Across the Web

DevServer - webpack
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >
Webpack-dev-server compiles files but does not refresh or ...
Two things were causing my problems here: module.exports = { entry: './src/index.js', output: { // For some reason, the `__dirname` was not ...
Read more >
How I solved and debugged my Webpack issue through trial ...
When webpack bundles your source code, it can become difficult to track down errors and warnings to their original location.
Read more >
Configuration Reference | Vue CLI
devServer #. Type: Object. All options for webpack-dev-server are supported. Note that: Some ...
Read more >
troubleshooting.md - Webpacker Docs
If you receive this error when running $ ./bin/webpack-dev-server ensure your configuration is correct; most likely the path to your “packs” folder is...
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