-
-
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
TypeError: Cannot read property 'headers' of null at Server.socket.on (***/node_modules/webpack-dev-server/lib/servers/SockJSServer.js:68:32) #2199
Comments
Please provide minimum reproducible test repo, i can't reproduce |
Seems like an unsolved issue in sockjs sockjs/sockjs-node#121 |
@Loonride i am thinking we should mark this as bug 😞 |
I have this issue as well. Here's my const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');
module.exports = {
entry: './index.js',
output: {
filename: 'index.js',
path: __dirname + '/dist'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loaders: ['babel-loader']
}
]
},
plugins: [
new CopyPlugin([{ from: './*.css', to: './' }]),
new HtmlWebpackPlugin({
template: './index.html'
})
]
}; And my {
"name": "with-grid",
"version": "1.0.0",
"private": true,
"description": "",
"main": "index.js",
"scripts": {
"start": "webpack-dev-server --hot --inline --open",
"build": "rm -rf dist && webpack --mode=production",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "",
"devDependencies": {
"babel-loader": "^8.0.6",
"copy-webpack-plugin": "^5.0.4",
"html-webpack-plugin": "^3.2.0",
"webpack": "^4.39.1",
"webpack-cli": "^3.3.7",
"webpack-dev-server": "^3.7.2"
},
"dependencies": {
"syft.js": "file:../.."
}
} The exact bug report:
OS: Mojave 10.14.6 |
We've been running into this issue as well. It's generally very intermittent, but I was able to reproduce it consistently by maxing out the cpu/memory utilization of the machine our app is running on (using a prime95 torture test), then navigating to the app. It only appears to occur when navigating directly to a url, or when refreshing the page. Checking the console output in chrome shows the following errors:
It's also worth mentioning that adding either of the following two bits to our webpack.config.js file resolves the issue if you do what I said above; however, we're still seeing the failure occur in our linux docker containers in CircleCI. Those settings are:
|
@evilebottnawi Do you mean we should put the fix on |
This comment has been minimized.
This comment has been minimized.
@Loonride yes, fix should be in master |
什么时候可以发布新的版本啊,,我要被这个问题搞死了,或者有没有什么其他的解决方法啊,一直在等新的版本出来 |
This has been fixed in their master branch, but not yet released. I too would like a release soon, as it definitely impacts our automation, but in the meantime you can get the fix by pointing your package manager to their master branch. In NPM, that would mean changing the package.json reference to: "webpack-dev-server": "webpack/webpack-dev-server#master". Hopefully this helps =) |
ok,我对这个不太懂,我现在是降低到3.7.0的版本了,暂时没有问题,而且具体没有研究过vue-cli3初始化的项目为什么package.json中的webpack是一个,,而不是分开的 |
Sorry, Google Translate is failing me here. I'm not sure what you're asking. I will say that if you've found a working version, go with that for now until the team pushes a new one, as the issue is fixed on master, but not yet pushed out. Hopefully they push it soon 🤞 |
ok thanks |
Does anyone have any further information on the release schedule to resolve this? |
stumbled upon this issue as this actually occurs randomly for me when using
|
Getting the exact same problem:
Windows Server 2012 R2 Angular CLI: 7.3.9 Package Version@angular-devkit/architect 0.6.8 |
I don't know what you mean by this. There's no such thing as an npm package at |
I see this issue intermittently when running an Angular app from a VS Code terminal. If I close VS Code and run it from a normal cli, I don't seem to ever see it... |
Apologies, I omitted the #master portion in my comment. I updated the comment, but just for clarity's sake, it should be: |
@cereallarceny try adding the following in your webpack.config.js: I was having the same issue and this seemed to resolve it. |
@jtrump70 it's really works, and there's one thing should be noticed is that you should confirm that's not another server(port 3000) which you run before, you can change another port to test it |
The fix is released! Seems to be working for me so far, give it few days though... |
I still don't see a fix. Any workaround? |
@iyer24 update your deps and lock file |
Sorry, how would I go about doing that? |
Please read how to use package manager |
I got this error when doing npm start. I closed vlcplayer and did npm start again, and the problem went away. once the app is running, i can run vlc player again. this is most likely an issue with some application opening a port that either sockjsserver wants to open, or does not respond correctly to sockjsserver connection. so close all unnecessary apps. alternatively sockjsserver people should report which port they tried to open and what they tried to do, so developers can more effectively close the offending applications. |
Expected Behavior
connection
should not be nullActual Behavior
TypeError: Cannot read property 'headers' of null at Server.socket.on (***/node_modules/webpack-dev-server/lib/servers/SockJSServer.js:68:32)
For Bugs; How can we reproduce the behavior?
This bug is difficult to reproduce. It happens occasionally.
webpack-dev-server/lib/servers/SockJSServer.js
Lines 65 to 69 in 2d44ef8
line 67 should become
For Features; What is the motivation and/or use-case for the feature?
The text was updated successfully, but these errors were encountered: