unintended public route generated for `src/pages/community/Loader.style.js`
Description
In Gatsby, all js files placed under src/pages/ are automatically treated as site routes unless specifically ignored.
Currently, Loader.style.js (which is just a styled-component used for the community calendar loading fallback) is located directly inside src/pages/community/ path -> https://github.com/layer5io/layer5/blob/master/src/pages/community/Loader.style.js
Because of this, Gatsby builds an unintended standalone route.
Visiting this URL on production returns an HTTP 200 with the global header and footer, but with an empty body containing only the rendered
.Internal helper stylesheets shouldn't be under src/pages/ as it causes unnecessary build artifacts and leaves empty/soft-404 routes exposed to crawlers.
Steps to Reproduce
- Query the live URL via curl: "curl -sI https://layer5.io/community/Loader.style/" This returns HTTP/2 200, whereas an invalid route (e.g. /community/invalid-page/) properly returns 404.
- You can also directly go to https://layer5.io/community/Loader.style which is an empty page produced because of the exact reason.
Expected Behavior
Loader.style.js should live in src/sections/Community/Calendar/ alongside the other calendar components/styles, and /community/Loader.style/ should not exist as a site page.
Screenshots
Environment:
- Host OS: MacOS
- Browser: Chrome
Contributor Resources and Handbook
The layer5.io website uses Gatsby, React, and GitHub Pages. Site content is found under the master branch.
- π See contributing instructions.
- π¨ Wireframes and designs for Layer5 site in Figma (open invite)
- ππΎππΌ Questions: Discussion Forum and Community Slack.
Join the Layer5 Community by submitting your community member form.
I would like to take this issue. I have the project locally setup and can make a PR. Here is my proposed fix:
1.Move src/pages/community/Loader.style.js to src/sections/Community/Calendar/loader.style.js.
2.Update the import in src/pages/community/calendar.js: "import Loader from "../../sections/Community/Calendar/loader.style";"
you can tag maintainers in slack for the issue to get assigned to you