-
-
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
Anyone here got webpack-dev-server to work on Cloud 9? #230
Comments
This might help. Assuming you want to use react-hot-loader.
|
works for me |
Hot reloading isn't working for me. My site comes up at https://react-tsongas.c9.io/ however in the browser console I'm getting repeated errors that make it look like hot reload is trying to happen over http rather than https and getting blocked: abstract-xhr.js?96d9:128 Mixed Content: The page at 'https://react-tsongas.c9.io/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://react-tsongas.c9.io:8080/sockjs-node/info?t=1461778636613'. This request has been blocked; the content must be served over HTTPS. Any ideas how to solve this? I wonder if it's related to this webpack-dev-server bug? https://community.c9.io/t/mixed-content-with-webpack-dev-server/3053 |
As per https://community.c9.io/t/mixed-content-with-webpack-dev-server/3053/4 After this, you should be able to run dev server with cli, without the I don't know enough to judge whether this applies to C9 or other https servers in general, and I wonder if anyone should do a pull request on this..? |
There's an open pull request #470 maybe someone can rattle the chain of the maintainer? |
I was having this problem too on cloud9. After playing around with it for awhile, I got hot reloading on cloud9 to work with webpack-dev-server 1.14.1 without any patches. The key change I made was creating Running Here's the full var webpack = require('webpack');
const path = require('path');
module.exports = {
"entry": [
'webpack-dev-server/client?https://0.0.0.0:8080',
'webpack/hot/only-dev-server',
'./app/index.js'
],
"output": {
"path": path.join(__dirname, 'build'),
"filename": "bundle.js"
},
devtool: "source-map",
"module": {
"loaders": [
{
"test": /.js?$/,
"loader": 'react-hot!babel-loader',
"exclude": /node_modules/
},
{
"test": /\.scss$/,
"loaders": ["style", "css?sourceMap", "sass?sourceMap"]
}
]
},
devServer: {
contentBase: './build',
hot: true
},
plugins: [
new webpack.HotModuleReplacementPlugin()
]
}; |
Can't get it working as described. Works only for me in c9 with patching as mentioned by @joonhyublee |
For a working example, you can clone this bare-bones react boilerplate repository: https://github.com/eloquently/react-boilerplate .
Change something in the App component, and you should see the HMR working. |
Ok. i will try again tomorrow. i will get back. Thank you. |
You are right, this configuration works in cloud9 without any mods to: client.js. I'm investigation what the difference actually is. |
It was completely my fault. I had some overrides in the webpack.config.babel.js for the entry-point, ENV-vars and mcuh more. After fixing my errors - everything runs smoothely. Thanks for the helpful hint! |
Glad you got it working! |
Hey here's another option if just looking for the essentials: blank-merrn-c9. Check out the webpack.dev.config.js and package.json to see what it's using. |
Closing because it seems to be working :). |
@emckay thanks, it works for me :) |
1.In order to get it working, I went into the file that the npm start script calls, "./node_modules/webpack-dev-server/bin/webpack-dev-server.js"
|
@AndrewNgKF That worked for me thanks a bunch! |
i did all of the things posted here included the last one (modifcation of webpack-dev-server.js) and i cant make work , i got on browser console [WDS] Disconnected! , i will appreciate you help . Thanks |
In webpack.config.js: devServer: { |
i did all of the things posted here too... does not work! |
|
Thank you @adleviton ! That worked for me. |
Adding this |
GET http://0.0.0.0:8080/packs/application.js net::ERR_EMPTY_RESPONSE |
webpack-dev-server --public your-project.c9users.io --host $IP --port $PORT --hot --inline -- |
I struggled for so long until trying @x5engine's suggestions. THANK YOU! I finally got it to work. |
If anyone comes across this, I wanted to share my solution because I know how frustrating this can be (for the new AWS Cloud 9): EDIT (thanks @jakewatton95) {
} Create a script in your package.json: Then open the terminal in AWS Cloud 9, and run the script: The terminal should output "Project is running at http://0.0.0.0:8080/" Just click on the address, and choose "open," it will open a new browser window pointing to the page. |
@Johnzy916 Solution works, but you need to make sure you're allowing inbound connections on port 8080 from the IP that you are trying to see the page from. |
Try below config and make sure to set https: false devServer: { |
this is related to the glory days of c9, not the new weird aws c9 |
Hi, since webpack-dev-server has a dependency on node-gyp ( see issue #229 ) we tried using it with cloud 9 which runs an online editor on a Linux machine. The installations of webpack-dev-server on cloud 9 goes smoothly but requests to it were not successful. I suspect it has something to do with a different networking paradigm.
All the tutorials I've found on webpack-dev-server show the index.html will have a script tag with the source of the output bundle.js coming from the webpack-dev-server at localhost:8080 which is the default... when you run on your local machine it make sense to access the server via localhost, but when you run the webpack-dev-server on cloud 9 it should be something else. a normal express app could be accessible via their scheme - https:// + your username + / + your workspace name - serving as if you would run localhost, so I tried that scheme and it didn't work, I tried using 0.0.0.0:8080 and it didn't work. I also noticed that c9 runs on https and the webpack-dev-server must assume plain http when communicating with the client via socket.io...
In short - I'd appreciate any help from someone who managed to get the webpack-dev-server to run on c9...
Thanks
Ajar
The text was updated successfully, but these errors were encountered: