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
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
When using an image() in a content collection schema in the attached minimal repro, if an entry uses an SVG, astro build exits early without generating any page and without returning an error code.
The repro repo is trimmed down to a minimum. The only dependencies are astro and @astrojs/check. Note that I cannot provide a link to Stackblitz, since Astro v6 requires Node 22 and Stackblitz only provides Node 20.
Here's the README of the repro, with all the details:
In the latest v5, astro build generates the expected HTML files for all articles, but in v6 beta it does not. It just exits with no error and no generated files. Trying all the NODE_OPTIONS I could think of did not help.
Using image() in the content schema, and any SVG image in the entry, seems to trigger it. See the comment in content/articles/article-2.yaml.
How to reproduce
The repro uses node 22.22.0 and pnpm 10.30.0, although I don't think it matters much. I had the exact same issue with node 25 and pnpm 10.29.
I trimmed everything down to the bare minimum, so the entries' content isn't even used and the articles are just a YAML collection (as to not depend on MDX or anything else).
# Make sure to clear everything before any new build
rm -rf node_modules/.astro .astro dist
# Build. The NODE_OPTIONS don't really matter, since there's nothing# reported anyway.
NODE_OPTIONS="\ --unhandled-rejections strict \ --trace-warnings \ --report-on-fatalerror \ --report-uncaught-exception \ --trace-uncaught \" astro build
The weird "fix"
See the comment in content/articles/article-2.yaml:
# it works if commented out and the next one is used instead :(hero: './boy-reading.svg'# hero: './hero1.webp'
Changing from an SVG (relative or not) to a WEBP (relative or not) makes the build work as expected, i.e. generate the HTML files for the two articles.
--- 1/build.svg.log+++ 2/build.webp.log@@ -12,3 +12,10 @@
[build] Rearranging server assets...
generating static routes
+ ├─ /article-2/index.html (+##ms)+ ├─ /article-1/index.html (+##ms)+✓ Completed in ##ms.++[build] ✓ Completed in ##ms.+[build] 2 page(s) built in ##ms+[build] Complete!
Observations
The SVG image gets copied into dist/_astro/, like the WEBP.
Whenever the SVG image is used, the getStaticPaths() function (in src/pages/[id]/index.astro) is never invoked (if I log to the console first thing inside it, that log is never emitted).
In src/pages/[id]/index.astro, if I don't use a top-level await and instead move the call to getCollection() inside of getStaticPaths(), the build works as expected.
Tip
This suggest an Astro v6 regression related to top-level awaits.
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
When using an
image()in a content collection schema in the attached minimal repro, if an entry uses an SVG,astro buildexits early without generating any page and without returning an error code.The repro repo is trimmed down to a minimum. The only dependencies are
astroand@astrojs/check. Note that I cannot provide a link to Stackblitz, since Astro v6 requires Node 22 and Stackblitz only provides Node 20.Here's the README of the repro, with all the details:
In the latest v5,
astro buildgenerates the expected HTML files for all articles, but in v6 beta it does not. It just exits with no error and no generated files. Trying all theNODE_OPTIONSI could think of did not help.Using
image()in the content schema, and any SVG image in the entry, seems to trigger it. See the comment incontent/articles/article-2.yaml.How to reproduce
The repro uses node 22.22.0 and pnpm 10.30.0, although I don't think it matters much. I had the exact same issue with node 25 and pnpm 10.29.
I trimmed everything down to the bare minimum, so the entries' content isn't even used and the articles are just a YAML collection (as to not depend on MDX or anything else).
The weird "fix"
See the comment in
content/articles/article-2.yaml:Changing from an SVG (relative or not) to a WEBP (relative or not) makes the build work as expected, i.e. generate the HTML files for the two articles.
Observations
dist/_astro/, like the WEBP.getStaticPaths()function (insrc/pages/[id]/index.astro) is never invoked (if I log to the console first thing inside it, that log is never emitted).src/pages/[id]/index.astro, if I don't use a top-level await and instead move the call togetCollection()inside ofgetStaticPaths(), the build works as expected.Tip
This suggest an Astro v6 regression related to top-level awaits.
What's the expected result?
The build used to work fine up to the latest v5.
Link to Minimal Reproducible Example
https://github.com/jcayzac/astro-repro-v6-svg
Participation