Deployed gatsby proyect on nginx and reach router mix breaks the styles on refreshing page #33409
-
Preliminary Checks
DescriptionI have a SPA landing page build with gatsby and deployed on a server with nginx. My index.js files show this:
The Home component goes like this:
You can see the live demo on www.bantel.com.ve Thanks for any help you can give me about this. Reproduction LinkSteps to Reproduce
Expected ResultThe pages must be showed on the same way using the navigation bar. Actual ResultFor any reason, reach router are mixing the styles between the main page component (Home) and the rest of pages. EnvironmentSystem:
OS: Ubuntu Server 20.04
CPU: Virtualized 4-Core
Binaries:
Node: 14.16.0
npm: 6.14.15
Languages:
Javascript: ECMASCRIPT > 6
Browsers:
Chrome: 94.0.4606.61
npmPackages:
"@ant-design/icons": "^4.6.2",
"@apollo/client": "^3.4.15",
"@reach/router": "^1.3.4",
"antd": "^4.16.10",
"babel-plugin-styled-components": "^1.13.2",
"dayjs": "^1.10.7",
"gatsby": "^3.10.2",
"gatsby-plugin-antd": "^2.2.0",
"gatsby-plugin-react-helmet": "^4.10.0",
"gatsby-plugin-resolve-src": "^2.1.0",
"gatsby-plugin-sass": "^4.10.0",
"gatsby-plugin-styled-components": "^4.10.0",
"graphql": "^15.6.0",
"markdown-to-jsx": "^7.1.3",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-helmet": "^6.1.0",
"react-hook-reading-time": "^1.0.0",
"sass": "^1.37.0",
"styled-components": "^5.3.0",
"typewriter-effect": "^2.18.0" Config FlagsNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This was fixed implementing the new way to use the reach-router as described here removing the content on the file gatsby-node.js about I create a file called
|
Beta Was this translation helpful? Give feedback.
This was fixed implementing the new way to use the reach-router as described here removing the content on the file gatsby-node.js about
onCreatePage
.I create a file called
[...].js
underpages
directory and added this config on thenginx configuration file
: