You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Gatsby is not picking up a file with the name template-create in any folder/sub-folder within the src/pages directory. Works perfectly fine with other names.
Steps to reproduce
Create a template-create.js or template-create.tsx file anywhere in the src/pages directory and try navigating in the browser.
This is expected behavior as Gatsby ignores files starting with template-. The previous behavior was added back in 2016 -- probably with the intention that people can store their templates in src/pages without creating pages for them.
Anyways, removing that behavior would be a breaking change so for now you'll need to rename your files if your intention for them is to be created :)
We're marking this issue as answered and closing it for now but please feel free to comment here if you would like to continue this discussion. We also recommend heading over to our communities if you have questions that are not bug reports or feature requests. We hope we managed to help and thank you for using Gatsby!
Description
Gatsby is not picking up a file with the name
template-create
in any folder/sub-folder within thesrc/pages
directory. Works perfectly fine with other names.Steps to reproduce
Create a
template-create.js
ortemplate-create.tsx
file anywhere in thesrc/pages
directory and try navigating in the browser.Have provided a minimal reproduction case here for anyone wanting to try: https://github.com/shripadk/test-repo
Expected result
Should render a page with "Hello World".
Actual result
Get a 404 instead.
This is with
template-create.tsx
file insrc/pages
( https://localhost:8000/template-create )This is with
template-create.js
file insrc/pages/admin
( https://localhost:8000/admin/template-create )Environment
The text was updated successfully, but these errors were encountered: