cloverfield-tools / universal-react-boilerplate

A simple boilerplate Node app.
MIT License
904 stars 97 forks source link

no index.js #75

Open sylvainlap opened 8 years ago

sylvainlap commented 8 years ago

Hi,

After a git clone & npm install, I try to run the devServer thanks to npm start. Here is the log:

sylvainlap@CanHardXI:~/DEV/WORKSPACE/universal-react-boilerplate$ npm start

> universal-react-boilerplate@3.0.0 start /home/sylvainlap/DEV/WORKSPACE/universal-react-boilerplate
> cross-env NODE_PATH=source babel-node devServer.js

Listening at http://0.0.0.0:3000
webpack built 151bfb56c4b20df6835c in 1366ms

However, when I try to reach http://localhost:3000/, I got a blank page. Moreover, I don't have any index.js in the static folder. What am I doing wrong ?

Thanks.

nkbt commented 8 years ago

May it be related to https://github.com/cloverfield-tools/universal-react-boilerplate/pull/73 ?

ericelliott commented 8 years ago

Verified. Something broke the Redux store hookups, and this reveals a big weakness in our tests. We need to test the actual data being rendered, rather than simply checking that the routes don't have errors.

I'm currently occupied with encapsulating all these hookups in react-easy-universal. When that is finished, I'll replace the code here.

In the meantime, I think it would be useful to figure out what's going on here. It may even help me with the work I'm doing. Would anybody like to investigate and try a PR?

nkbt commented 8 years ago

I can do e2e tests. I have smoke-tests in place for all my libs.

nkbt commented 8 years ago

Created https://github.com/cloverfield-tools/universal-react-boilerplate/issues/76

ericelliott commented 8 years ago

I don't have any index.js in the static folder.

You shouldn't. index.js gets served from /build. You should not see a 404 error for /static/index.js. Do you? If so, try:

npm run build
ericelliott commented 8 years ago

The missing index file should be fixed by https://github.com/cloverfield-tools/universal-react-boilerplate/pull/71. Basically, just run npm run build.

robbestad commented 8 years ago

Can confirm. npm run build fixes it. However, I ran into a couple of other issues. I get undefined in location when accessing http://0.0.0.0:8080. Accessing the test-data route manually works just fine. Additionally, I can't really get any effect out of the hot-reload, because if I for instance edit the test-data component manually, nothing happens. If I refresh, the changes are visible for a second, before being replaced by the static content.

mgreer commented 8 years ago

Agreed with @svenanders , having exactly the same issue after running build then start. Backend is hot compiling, but front end does not seem to be listening and even a hard refresh shows new code for an instant, before reverting to old code from manual build.

ericelliott commented 8 years ago

Open to PRs! Would one of you like to tackle these issues?