-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Description
Description
I picked up a template and converted to a react a component. I then decided to pass its styles through link tag in header of the page using react-helmet.
The styles work fine when I route the the page without no trailing slash but on routing to the pages with a trailing slash, the styles do not work. I have searched around but looks like the issue is unique to me
Steps to reproduce
- Create gatsby project, I default starter for this project
- Inside root folder, add a
staticfolder - Add a
custom.cssfile with some styles that will be referenced inside custom page - Create custom page in src/pages
- Add link prop to SEO component and set it up correctly, this used to pass link to SEO component inside custom page
- Inside custom_page.js and link to custom.css file using SEO component
- Add
<Link to "/custom_page" >custom page</Link>inside pages/index.js file - The page will load as required
- The page won't load correctly when custom page is linked to using
<Link to='/custom_page/'>Custom page</Link> - Refreshing the page too won't load the custom css styles
Clear steps describing how to reproduce the issue. Please please please link to a demo project if possible, this makes your issue much easier to diagnose (seriously).
What should happen?
Custom css should load in page when page is routed to with trailing slash
What happened.
Custom css does not load when page is routed to with trailing slash however, the link to the custom css file is available in the header tag
Environment
System:
OS: Windows 10
CPU: (4) x64 Intel(R) Core(TM) i7-5500U CPU @ 2.40GHz
Binaries:
Yarn: 1.12.3 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.4.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: 42.17134.1.0
npmPackages:
gatsby: ^2.0.117 => 2.0.117
gatsby-image: ^2.0.29 => 2.0.29
gatsby-plugin-manifest: ^2.0.17 => 2.0.17
gatsby-plugin-offline: ^2.0.23 => 2.0.23
gatsby-plugin-react-helmet: ^3.0.6 => 3.0.6
gatsby-plugin-remove-trailing-slashes: ^2.0.7 => 2.0.7
gatsby-plugin-sharp: ^2.0.20 => 2.0.20
gatsby-source-filesystem: ^2.0.20 => 2.0.20
gatsby-transformer-sharp: ^2.1.13 => 2.1.13