Vite's define
dev-mode timing issues in .astro
files
#11874
Labels
needs triage
Issue needs to be triaged
define
dev-mode timing issues in .astro
files
#11874
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
In development mode, it's possible that values defined in Vite's
define
are not present in.astro
files immediately. Note that there is a difference in Vite howdefine
works when comparing dev and prod modes - prod uses static replacements, dev adds them toglobalThis
on runtime.Maybe Astro is loading
.astro
files before Vite defines values fromdefine
? Is Astro now too fast?What's the expected result?
Values defined in Vite's
define
should always be present, even in.astro
files. Thedefine
option should provide similar results in dev as it does in prod.Link to Minimal Reproducible Example
https://stackblitz.com/~/edit/github-5kyhn9?file=src%2Fpages%2Findex.astro
Participation
The text was updated successfully, but these errors were encountered: