Astro Info
Astro v7.2.0
Vite v8.2.1
Node v26.7.0
System macOS (arm64)
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
After upgrading astro from version 5.17.1 to version 7.2.0 for a project, I became unable to build astro pages via astro build whose astro files:
- sit within
/src/pages/[format]/[lang]/
- had the following content within their frontmatter:
export async function getStaticPaths() {
return [
{ params: { format: 'first', lang: 'en' } },
{ params: { format: 'second', lang: 'en' } },
{ params: { format: 'third', lang: 'en' } },
{ params: { format: 'first', lang: 'de' } },
{ params: { format: 'second', lang: 'de' } },
{ params: { format: 'third', lang: 'de' } },
];
}
const {format, lang} = Astro.params;
When e.g. trying to astro build the page /src/pages/[format]/[lang]/welcome.astro, I got a build error saying:
first/en/welcome.html13:58:55 [ERROR] TypeError: Missing parameter: format
... indicating that while the path parameter format of the page /src/pages/[format]/[lang]/welcome.astro could be properly resolved, it could not be recognized by the astro build cycle.
After hours of console-logging and seeing that the path parameters are properly resolved and available while the page was being built, I found that the problem was that I set the build.format option in the astro config file to preserve. When uncommenting that, the build succeeded as in version 5.17.1.
I further investigated on this and indeed setting the build.format option to directory (which is the default value hence equivalent of omission tested above) indeed does the trick.
That feels like a bug to me, especially because it did not happen in version 5.17.1; so I wondered if this change is intentional ? If so, it would be very helpful if the SSG docs could e.g. include a note about an incompatibility with the build.format setting.
What's the expected result?
Pages should be generated normally as in version 5.17.1.
In the linked example, try simply changing the value of the build.format config from preserve to directory and vice-versa in the projects' astro.config.mjs file, then re-run npm run build to try to rebuild the project and you will see what I mean.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-hdpeidlx?file=astro.config.mjs
Participation
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
After upgrading astro from version
5.17.1to version7.2.0for a project, I became unable to build astro pages viaastro buildwhose astro files:/src/pages/[format]/[lang]/When e.g. trying to
astro buildthe page/src/pages/[format]/[lang]/welcome.astro, I got a build error saying:first/en/welcome.html13:58:55 [ERROR] TypeError: Missing parameter: format... indicating that while the path parameter
formatof the page/src/pages/[format]/[lang]/welcome.astrocould be properly resolved, it could not be recognized by theastro buildcycle.After hours of console-logging and seeing that the path parameters are properly resolved and available while the page was being built, I found that the problem was that I set the build.format option in the astro config file to
preserve. When uncommenting that, the build succeeded as in version5.17.1.I further investigated on this and indeed setting the build.format option to
directory(which is the default value hence equivalent of omission tested above) indeed does the trick.That feels like a bug to me, especially because it did not happen in version
5.17.1; so I wondered if this change is intentional ? If so, it would be very helpful if the SSG docs could e.g. include a note about an incompatibility with the build.format setting.What's the expected result?
Pages should be generated normally as in version
5.17.1.In the linked example, try simply changing the value of the
build.formatconfig frompreservetodirectoryand vice-versa in the projects'astro.config.mjsfile, then re-runnpm run buildto try to rebuild the project and you will see what I mean.Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-hdpeidlx?file=astro.config.mjs
Participation