Astro Info
Astro v7.0.3
Node v24.15.0
System Linux (x64)
Package Manager pnpm
Output static
Adapter none
Integrations @astrojs/markdoc
create-files
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
When doing any kind of heavier file IO operation inside of the HTML/JSX markup part of an .astro file, while Astro is doing something else in the background, style tags may disappear from the build output altogether.
This bug will not happen when you have a fast SSD and the files requires have already been cached or loaded into memory.
The minimal reproduction tries to make this problem happen deterministically by:
- Creating 10MB of random bits of data
- Requiring a content collection that loads in files (i checked, a standalone site does not work, it needs to have the markdoc files for some reason)
- Loads in the 10MB file via
await inside of the JSX.
The temporary quick fix here is to move the file load call into the javascript part of the Astro file.
However, it's not intuitive or sometimes easy to spot that this is required. We only caught this by randomly spotting pages on our website missing specific styles, and reproducing this locally required us to find a machine with a slower/worse SSD. Needing to know where to put certain system-bound operations should not cause rendering to break in such a way.
What's the expected result?
The style tag should be inserted like normal and not dropped altogether, and any kind of File IO or system-bound operations should not affect the rendering.
Link to Minimal Reproducible Example
https://github.com/spaceemotion/astro-vanishing-style-on-file-io
Participation
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
When doing any kind of heavier file IO operation inside of the HTML/JSX markup part of an
.astrofile, while Astro is doing something else in the background,styletags may disappear from the build output altogether.This bug will not happen when you have a fast SSD and the files requires have already been cached or loaded into memory.
The minimal reproduction tries to make this problem happen deterministically by:
awaitinside of the JSX.The temporary quick fix here is to move the file load call into the javascript part of the Astro file.
However, it's not intuitive or sometimes easy to spot that this is required. We only caught this by randomly spotting pages on our website missing specific styles, and reproducing this locally required us to find a machine with a slower/worse SSD. Needing to know where to put certain system-bound operations should not cause rendering to break in such a way.
What's the expected result?
The style tag should be inserted like normal and not dropped altogether, and any kind of File IO or system-bound operations should not affect the rendering.
Link to Minimal Reproducible Example
https://github.com/spaceemotion/astro-vanishing-style-on-file-io
Participation