jedwards1211 / meteor-webpack-react

(DEPRECATED) use jedwards1211/crater instead
https://github.com/jedwards1211/crater
374 stars 75 forks source link

GET http://localhost:9090/ 502 Bad Gateway #144

Closed mqklin closed 8 years ago

mqklin commented 8 years ago

My steps:

  1. git clone
  2. npm i
  3. node dev.js
  4. open in browser http://localhost:9090/ I see an error 502 Bad Gateway in console: http://localhost:9090/favicon.ico Failed to load resource: the server responded with a status of 502 (Bad Gateway) http://localhost:9090/ Failed to load resource: the server responded with a status of 502 (Bad Gateway) But I can get this file: http://localhost:9090/client.bundle.js What is the problem can be?

node dev.js output:

maksim@maksim-K50ID ~/gitlab/meteor-webpack-react $ node dev.js 
Building core-js@2.4.1 without ES6 number constructor...
Build completed in 24.2s

Hash: c618492ab8fb5a6df674
Version: webpack 1.13.1
Time: 24203ms
               Asset     Size  Chunks             Chunk Names
    server.bundle.js     1 MB       0  [emitted]  main
server.bundle.js.map  1.13 MB       0  [emitted]  main
chunk    {0} server.bundle.js, server.bundle.js.map (main) 917 kB [rendered]
  build [===       ] 27%
Build completed in 0.192s

Hash: c618492ab8fb5a6df674
Version: webpack 1.13.1
Time: 192ms
               Asset     Size  Chunks       Chunk Names
    server.bundle.js     1 MB       0       main
server.bundle.js.map  1.13 MB       0       main
chunk    {0} server.bundle.js, server.bundle.js.map (main) 917 kB
Build completed in 32.567s

Hash: 5c23d6de72ad9c619028
Version: webpack 1.13.1
Time: 32568ms
           Asset     Size  Chunks             Chunk Names
client.bundle.js  1.57 MB       0  [emitted]  main
chunk    {0} client.bundle.js (main) 1.3 MB [rendered]
webpack: bundle is now VALID.
jedwards1211 commented 8 years ago

Did you edit something? The port should definitely be 9090, I don't see how it would just change to 9091 all by itself...

mqklin commented 8 years ago

Sorry, it's a typo - file at http://localhost:9090/client.bundle.js

jedwards1211 commented 8 years ago

Ah, so webpack finished building but it looks like Meteor didn't start up yet. Wait for it to say

=> App running at: http://localhost:3000/

Before trying to open the page in the web browser.

HTTP 502 often means that a reverse proxy server gets an invalid response from the upstream server. In this case webpack-dev-server is already up and running on port 9090, but Meteor isn't running yet, so when webpack-dev-server fails to access it, it generates a 502 error.

I'm closing this, but if that doesn't work let me know and I'll reopen it.

mqklin commented 8 years ago

Yes. thank you. Meteor start is so slow...

jedwards1211 commented 8 years ago

Yep. Personally I stick with old Meteor 1.0.5, because it's faster. MDG really made a mistake rolling their own bundler in 1.2 instead of just using Webpack.

jedwards1211 commented 8 years ago

(just look: over 75 upvotes on this issue: https://github.com/meteor/meteor/issues/4284)