react-firebase-starter icon indicating copy to clipboard operation
react-firebase-starter copied to clipboard

yarn start can't access /about page -> working fine on "yarn build"

Open klijakub opened this issue 8 years ago • 2 comments

Hello, I have a strange problem.

after clone react-static-boilerplate project from github and install all dependencies and use $ yarn start, everything working fine except one thing, When I click on "About" button it's not redirecting me to /about it just change address and stay in home page,

When I use $ yarn build, and copy all files from public folder to my hosting it's working just perfect

but I want to test it in development mode (yarn start) on my vps and there is weird stuff

fragment of my routes.json

  {
    "path": "/about",
    "page": "./about"    
  },

but if I change my routes json to

   {
    "path": "/sign_up",
    "page": "./sign_up",
    "chunk": "main"
  },

/about working in development mode (yarn start) but not working after yarn build and copy to static files to hosting

I don't understand that chunk option, any help please?

klijakub avatar Feb 22 '17 16:02 klijakub

@klijakub Did you solve this problem? I was unable to replicate it with a fresh install.

About the chunk option: it's used for code-splitting in webpack. You can check out tools/routes-loader.js to find out how this is implemented. (From what I understand, you should set "chunk": "main" for pages that you want to be bundled into the main.js file, like the home page. Webpack will decide how to bundle the rest.)

mksarge avatar Mar 08 '17 19:03 mksarge

I reproduced this issue when I had port 3000 being used by another server, then RSB used 3003. The about link did not work as it was trying to get the chunk from port 3000?

Jaikant avatar May 03 '17 14:05 Jaikant