Open sauldeleon opened 10 months ago
Hi @balazsorban44, I just checked this bug and it seems like there is an issue while checking whether the page path is dynamic or not using pageExtensions.
I would love to work on this and I have a first draft of the solution ready. I would like to raise a PR for this.
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
App Router
Link to the code that reproduces this issue or a replay of the bug
https://codesandbox.io/p/sandbox/nervous-gould-p2j5xj
To Reproduce
Start app in dev mode
yarn dev
Go to path
/sitemap.xml
will return 404 not found
if you rename the
sitemap.ts
tositemap.next.ts
(according to pageExtensions) it will fail as it does not know how to parse itDescribe the Bug
When starting the app, and
pageExtensions
are set innext.config
, thesitemap.ts
is not working unless you add its extension.So, in next.config.js
and
sitemap.ts
will workand
sitemap.ts
will failand
sitemap.next.ts
will failI guess that as
sitemap
file is a file threated by next framework, it could be handled the same way as layout, page... etcMaybe this is not a bug, it is a feature request. Apologize in that case and please move the issue to its respective category.
Expected Behavior
When you have
pageExtensions
enabled, those rules should apply tositemap
as well as other nextJS reserved filesWhich browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
NEXT-1634