Skip to content
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

sockjs-node请求报 400 #130

Open
deepthan opened this issue Feb 22, 2021 · 0 comments
Open

sockjs-node请求报 400 #130

deepthan opened this issue Feb 22, 2021 · 0 comments

Comments

@deepthan
Copy link
Owner

  • 问题
    项目运行时一直发http://localhost:8080/sockjs-node/info?t=1462183700002请求,导致chrome控制台很卡。

  • 解决方法
    这是因为webpack配置的原因,形如

entry: {
    App: [
        'webpack-dev-server/client?http://localhost:8080/assets/',
        'webpack/hot/only-dev-server',
        './client/javascripts/entry'
    ]},
    output: {
        path: path.join(__dirname, 'app', 'assets', 'javascripts'),
        filename: '[name]_wp_bundle.js',
        publicPath: 'http://localhost:8080/assets'
    }

将上面的第一行修改如下即可解决。

webpack-dev-server/client?http://localhost:8080/

但是如果使用angular/cli创建的项目的话则不能这样做,因为webpack配置是集成在脚手架中我们是接触不到的,所以更改脚手架和typescript版本即可解决此问题。

"@angular/cli": "1.2.7",
"typescript": "2.3.4"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant