electrode-io / electrode

Web applications with node.js and React
Other
2.1k stars 300 forks source link

Missing style.css and bundle.dev.js when running gulp dev #106

Closed glawson closed 7 years ago

glawson commented 7 years ago

Style.css and bundle.dev.js 404'ing when running development mode. Looks like the cache key used in .isomorphic-loader-config.json does not match the key found in isomorphic-assets.json. I can hard set the key in the loader config, but gulp dev rewrites the file each run. Happening in the latest release on a fresh install.

jlim81 commented 7 years ago

Could this be related to - https://github.com/electrode-io/electrode/issues/88 ?

glawson commented 7 years ago

@jlim81 - yes, I believe so.

ananavati commented 7 years ago

@glawson @jlim81

I just tested with a fresh install of generator-electrode@1.6.0 and all the bundled assets load fine with a 200

screen shot 2017-01-12 at 11 05 34 am

Could you please try installing version 1.6.0 of generator-electrode

jlim81 commented 7 years ago

Thanks @ananavati I'll take a look at this tonight. Regarding some of these generator errors, particularly with dev & production builds. Would the npm version, node version, yo version really affect using this project?

glawson commented 7 years ago

@ananavati @jlim81; I updated generator-electrode and did a fresh install - all works. Please note: I ran into this issue on an existing project first, before trying a new yeoman generated project. I was able to fix the existing project by adding the electrode-react-ssr-caching additions to server/index.js and installing electrode-react-ssr-caching, electrode-react-webapp. I got into this mess after doing a fresh npm install (rm -rf node_modules; npm install). Seems like an upgrade path is missing? I guess you could rerun 'yo electrode', and respond no to the overwrites except server/index.js then install the missing npm's.

riccijs commented 7 years ago

@ananavati Hi! Thanks for all your work on this! The app runs fines with dev bundles, but when running gulp build npm run prod i get: bundle.b269d67….js:1 Uncaught SyntaxError: Unexpected token <.

oliwerhelsen commented 7 years ago

It is same for both Express and Koa. Hapi works fine.

riccijs commented 7 years ago

@oliwerhelsen , Do you know if there are plans to fix this for Express? We are looking at electrode for a major refactor within our company, but are hoping to use our existing Express server, in hopes of expediting the project.

oliwerhelsen commented 7 years ago

I hope and think that @animesh10 are looking at it. We are also depending on this to work with Express. Hope they can figure it out soon.

riccijs commented 7 years ago

@oliwerhelsen , I looked at your repos and noticed MEAN.js / John Papa. I have used MEAN.js as a boilerplate on many projects and am a big fan of John Papa and Todd Motto! It's kinda a shame that ng2 lost so much traction.

JakobJingleheimer commented 7 years ago

After trying the re-running yo electrode solution proposed above, it now works for gulp build && gulp server, but not for gulp dev: We're getting a 404 on main.style.css (the default filename) because it's missing the hash, which is actually present in the fs but not the request.

We noticed that there are no css files listed in the stats.json file in <app>/dll/ (and <app>/.build/), from which react-webapp.js is reading. However, it is listed in <app>/dist/server/stats.json, from which gulp server reads.