-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Watch Options: Cannot read property 'poll' of undefineds #1217
Comments
@birdwell your webpack config isn't optional. include that, or we'll have to close this as invalid. |
@shellscape Okay, I've updated the report. Thank you. |
I'm unable to reproduce using the |
I cloned that repo you referenced and added watchContentBase. I then used webpack-dev-server command directly instead of npm run webpack-dev-server. That's with a fresh install of webpack-dev-server from npm. I was able to reproduce it.
|
That link was to a directory in this repo. So I don't know what you mean by that.
Then you were using a global version of I followed the same steps you did, including running using a global install of |
I clone this repo and went into examples/cli/watch-content-base.
It's starting to look like I'm seeing an isolated problem too. Thank you, @shellscape |
The options object passed into server for me is the following:
watchOptions is undefined.
That causes this.watchOptions to be undefined.
That causes these lines to fail. There could be a bit more defensive and if options.watchOptions is undefined set this.watchOptions to an empty object instead. That way you could safely check the poll option on the watchOptions. Unless watch options is always suppose to be defined from the options object and it's something local I've done. What do you think? @shellscape
|
Very strange case indeed. Starting WDS from both methods, on my end, produces and empty object without having to explicitly set it. And no error occurs. I'd like to know more about why your environment seems to be failing to setup the options object properly, but in the mean time you could open a PR for this, and it would be a good first contribution. |
@shellscape thanks so much for helping me with this. I'm a fish out of water in trying to figure this out. Someone at my company manages webpack. This happened to me today. I will put my investigation hat and do some digging. I want to get more involved in open source. |
@birdwell for sure. the first step is to fork this repo (there's a button near the top right on the main/home page of the repo). then you can change that line you mentioned and commit it. go with a commit message of something like "fixes #1217: strange case with default watchOptions value" or whatnot. push your commit to your fork, and you should see a button for opening a pull request on your fork's main/home github page. We'll review it (it'll be quick because it's a small change), merge it, and publish it. And you'll get credit for the fix. ping me on twitter at this same name if you get stuck along the way. |
Code
// webpack.config.js
// additional code, remove if not needed.
Expected Behavior
npm start would start the dev server.
Actual Behavior
npm start throws this error.
For Bugs; How can we reproduce the behavior?
watchContentBase is the trigger for the bug.
For Features; What is the motivation and/or use-case for the feature?
The text was updated successfully, but these errors were encountered: