Astro Info
Astro v6.0.4
Node v22.22.0
System Linux (x64)
Package Manager npm
Output static
Adapter none
Integrations none
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
When I return an HTML file from a static file endpoint that makes use of getStaticPaths to do dynamic routing, the .html ending is removed, causing a path mismatch and resulting in a NoMatchingStaticPathFound error. For example, if I have a path file.html returned as the param value in one of the getStaticPaths entries, I get the below error. If I change the param value to just file, the build succeeds but I end up with a file called file in the output that has no extension.
generating static routes
17:20:08 ├─ /index.html (+6ms)
17:20:08 ├─ /file.html17:20:08 [ERROR] NoMatchingStaticPathFound: A `getStaticPaths()` route pattern was matched, but no matching static path was found for requested path `/file`.
at AstroError (file:///home/projects/github-dnjnvdtp/dist/.prerender/chunks/prerender_BZ2JtAqQ.mjs:77:5)
at getProps (file:///home/projects/github-dnjnvdtp/dist/.prerender/chunks/prerender_BZ2JtAqQ.mjs:6844:11)
17:20:08 [ERROR] [build] Caught error rendering /file.html: NoMatchingStaticPathFound: A `getStaticPaths()` route pattern was matched, but no matching static path was found for requested path `/file`.
[NoMatchingStaticPathFound] A `getStaticPaths()` route pattern was matched, but no matching static path was found for requested path `/file`.
Hint:
Possible dynamic routes being matched: src/pages/[...path].ts.
Error reference:
https://docs.astro.build/en/reference/errors/no-matching-static-path-found/
Stack trace:
at AstroError (file:///home/projects/github-dnjnvdtp/dist/.prerender/chunks/prerender_BZ2JtAqQ.mjs:77:5)
What's the expected result?
I would expect using a param value like file.html from a static file endpoint to result in a successful build with a file called file.html in the output. This was the case in Astro v5. I've created both a v5 and v6 StackBlitz for comparison:
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-dnjnvdtp
Participation
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
When I return an HTML file from a static file endpoint that makes use of
getStaticPathsto do dynamic routing, the.htmlending is removed, causing a path mismatch and resulting in aNoMatchingStaticPathFounderror. For example, if I have a pathfile.htmlreturned as the param value in one of thegetStaticPathsentries, I get the below error. If I change the param value to justfile, the build succeeds but I end up with a file calledfilein the output that has no extension.What's the expected result?
I would expect using a param value like
file.htmlfrom a static file endpoint to result in a successful build with a file calledfile.htmlin the output. This was the case in Astro v5. I've created both a v5 and v6 StackBlitz for comparison:npm run buildsucceedsnpm run buildfailsLink to Minimal Reproducible Example
https://stackblitz.com/edit/github-dnjnvdtp
Participation