React-server failling without error

56 Views Asked by At

I created a simple project from generator-react-server . Everything worked fine.

I just created new route a new page and a new component and changes hello-world.js (page and component) for home.js.

Now when running npm start or react-server start the server shutdown without returning any particular error but the following logs (note that it was already logging the same mesage when it worked before).

2016-10-21T15:44:01.071Z - warning: [react-server-cli.src.logProductionWarnings] PRODUCTION WARNING: the following current settings are discouraged in production environments. (If you are developing, carry on!):
2016-10-21T15:44:01.075Z - warning: [react-server-cli.src.logProductionWarnings] -- Minification is disabled. To enable, set minify to true (--minify at the command-line) or set NODE_ENV=production.
2016-10-21T15:44:01.076Z - warning: [react-server-cli.src.logProductionWarnings] -- Long-term caching is disabled. To enable, set longTermCaching to true (--long-term-caching at the command-line) or set NODE_ENV=production to turn on.
2016-10-21T15:44:01.076Z - info: [react-server-cli.src.logProductionWarnings] NODE_ENV is set to undefined
2

There are 2 best solutions below

0
On BEST ANSWER

The issue was the route defined in routes.js was still pointing to a page that didn't exist anymore (page property). The route could not resolve.

routes.js :

{
  "middleware": [],
  "routes": {
  "Homepage": {
    "path": "/",
    "page": "pages/home.js"
  }
}
0
On

Hello sir you have to follow this steps to run your code

install yeoman

npm install -g yo

install the react-server generator

npm install -g generator-react-server

make a new react-server project in the CURRENT directory

yo react-server

run the new app

npm run start

go to http://localhost:3000