React webapp继续在PROD环境中加载本地主机资源

我已经部署了基于react-js的Web应用程序来制作环境,并且从浏览器控制台中,我可以看到有一些依赖代码停留在无休止的循环中,试图通过xhr从本地主机加载一些socketjs-node资源。 以下是我从浏览器控制台得到的消息:

 abstract-xhr.js:132 Mixed Content: The page at '[MY_WEBSITE_ADDRESS]' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://localhost:3000/sockjs-node/info?t=1469401504944'. This request has been blocked; the content must be served over HTTPS.o._start @ abstract-xhr.js:132(anonymous function) @ abstract-xhr.js:21 abstract-xhr.js:132 XMLHttpRequest cannot load http://localhost:3000/sockjs-node/info?t=1469401504944. Failed to start loading.o._start @ abstract-xhr.js:132(anonymous function) @ abstract-xhr.js:21 client:70 [WDS] Disconnected!l.onclose @ client:70n.dispatchEvent @ eventtarget.js:51(anonymous function) @ main.js:356 

我想知道是否在构build我的js包时错过了任何产品设置。 我正在使用webpack,这里是编译prod bundle js的设置:

 var path = require('path'); var webpack = require('webpack'); module.exports = { devtool: 'source-map', entry: [ 'webpack-dev-server/client?http://localhost:3000', 'webpack/hot/only-dev-server', './src/index', 'whatwg-fetch' ], output: { path: path.join(__dirname, 'public'), filename: 'bundle.js', publicPath: '/public/' }, plugins: [ new webpack.HotModuleReplacementPlugin(), new webpack.optimize.DedupePlugin(), new webpack.optimize.UglifyJsPlugin({ minimize: true, compress: { warnings: false } }), new webpack.DefinePlugin({ 'process.env': { 'NODE_ENV': JSON.stringify('production') } }) ], module: { loaders: [{ test: /\.js$/, loaders: ['react-hot', 'babel'], include: path.join(__dirname, 'src') }] } }; 

这里是我正在使用的依赖关系:

  "devDependencies": { "babel-core": "^6.0.20", "babel-eslint": "^4.1.3", "babel-loader": "^6.0.1", "babel-preset-es2015": "^6.0.15", "babel-preset-react": "^6.0.15", "babel-preset-stage-0": "^6.0.15", "eslint": "^1.10.3", "eslint-plugin-react": "^3.6.2", "react-hot-loader": "^1.3.0", "webpack": "^1.12.2", "webpack-dev-server": "^1.12.1" }, "dependencies": { "async": "^1.5.2", "express": "^4.13.4", "mixpanel": "^0.4.0", "mixpanel-browser": "^2.8.1", "radium": "^0.17.1", "react": "^0.14.6", "react-autosuggest": "^3.8.0", "react-bootstrap": "^0.29.4", "react-cookie": "^0.4.7", "react-dom": "^0.14.6", "react-ga": "^2.1.0", "react-geosuggest": "^1.23.0", "react-router": "^2.4.1", "whatwg-fetch": "^1.0.0" } 

我没有看到abstract-xhr.js在启动这个查询时检查任何显式标志。 请分享一些想法。 谢谢!

我通过从webpack config中的Entry属性中删除这条线来修复它。

'webpack-dev-server/client?http://localhost:3000',