alex35mil / generator-flux-on-rails

Scaffolder of universal Flux / Redux app, backed by Rails API.
158 stars 7 forks source link

Timeout on development on Node (Express) app #1

Closed andresgutgon closed 9 years ago

andresgutgon commented 9 years ago

I want to try this project.

  1. I've run generator
  2. I've set up rails api (migrations,...) I've a user created by curl
  3. I've setup nginx.
  4. I've run npm install on Express app.

When I go to http://lvh.me/ Nginx returns Timeout after x seconds.

I'm debugging. I've commented this line: https://github.com/alexfedoseev/generator-flux-on-rails/blob/master/app/templates/app/server.js#L33

And I've set up a dummy Express endpoint:

app.get('/', function (req, res) {
  res.send('Hello World!');
});

This is working

So following this clue I'm checking this file: https://github.com/alexfedoseev/generator-flux-on-rails/blob/master/app/templates/app/app/libs/initters/server.jsx#L31

I see that this request is ok on Rails log

Started GET "/auth/preflight => 200

But from here I do not know what to check. The thing is that the app ends returning timeout.

alex35mil commented 9 years ago

Hi, thanks for reporting!

Actually you don't need to run npm install, generator is doing it during scaffolding. It's just a note.

According to issue. Looks like the problem was here: https://github.com/alexfedoseev/generator-flux-on-rails/blob/900b9c802c92f952a889bab1cb62aa00beabb858/app/templates/app/app/bundles/app/routes/routes.jsx#L17

react-redux was updated and name of exposed component was changed: DecoratedComponent -> WrappedComponent.

I've updated all deps and published new version of generator.

Please update your version from npm (0.0.8 is latest) and write me back if it works or not. Thanks!

andresgutgon commented 9 years ago

Yeeesss! :clap: Thanks @alexfedoseev

Now works. I've noticed that with javascript disabled styles are not shown. Is that the expected behavior? image

BTW this is too my feeling about javascript environments :) https://twitter.com/xz/status/633894395385913344

alex35mil commented 9 years ago

Great, one part of issue is solved :+1:

Let's deal with styles. It's not expected behaviour. Can you show me output of npm start from console?

andresgutgon commented 9 years ago

This is my console ouput:

npm start

> my-universal-app@0.0.1 start /Users/me/my-code/my-app
> gulp start:dev

[14:31:08] Requiring external module babel-core/register
[14:31:09] Using gulpfile ~/my-code/my-app/gulpfile.babel.js
[14:31:09] Starting 'start:dev'...
[14:31:09] Starting 'clean'...
[14:31:09] Starting 'lint'...
[14:31:12] Finished 'lint' after 2.3 s
[14:31:12] Finished 'clean' after 2.32 s
[14:31:12] Starting 'bundle'...
[14:31:12] Starting 'images'...
[14:31:12] Starting 'copy'...
[14:31:12] Finished 'copy' after 27 ms
[14:31:12] gulp-imagemin: Minified 0 images
[14:31:12] Finished 'images' after 52 ms
[14:31:13] => 🔥  Webpack development server is running on port 3001
[14:31:18] Finished 'bundle' after 6.05 s
[14:31:18] Starting 'server'...
[14:31:18] Finished 'server' after 3.22 ms
[14:31:18] Starting 'watch'...
[14:31:18] Finished 'watch' after 17 ms
[14:31:18] Finished 'start:dev' after 8.4 s
[14:31:18] Time: 4610ms
    Asset     Size  Chunks             Chunk Names
   app.js   376 kB       0  [emitted]  app
vendor.js  1.22 MB       1  [emitted]  vendor
[14:31:18] webpack: bundle is now VALID.
[14:31:20] => 🚀  Express app development server is running on port 3500 
alex35mil commented 9 years ago

I've noticed that with javascript disabled styles are not shown. Is that the expected behavior?

Oh, I missed with javascript disabled part :sweat_smile: Yes, if javascript is disabled, then after npm start (in development env) styles will be disabled. Run npm run prod and they'll be there (production build) even if javascript is disabled.

Also I noticed after login I do not see the comments feature you have here: http://isomorphic-comments.alexfedoseev.com/

It's ok. Comments app is just an example. It's made on top of generated dummy app.

andresgutgon commented 9 years ago

Great, thanks for your help @alexfedoseev

I love this project. Now is my turn to do something with it :)

alex35mil commented 9 years ago

Go for it :+1: