Raw Astro import fails when the imported component contains import.meta.*
, only with Linux
#5074
Labels
- P4: important
Violate documented behavior or significantly impacts performance (priority)
What version of
astro
are you using?latest (1.4+)
Are you using an SSR adapter? If so, which one?
no
What package manager are you using?
pnpm
What operating system are you using?
debian/ubuntu/macos
Describe the Bug
it seems like importing an Astro file with the
?raw
flag make rollup crash when there is an import.meta.* Vite magic string present inside this file.It doesn't look like a project specific issue.
I was able to reproduce it with the GitHub CI (ubuntu) and a VPS with Debian. I enforce Node versions (nvm, and all…)
No problem whatsoever on macOS. These sort of problem are quite rare.
https://github.com/JulianCataldo/astro-content/actions/runs/3235598248/jobs/5300250836
https://discord.com/channels/830184174198718474/1029770089249112084/1030145628753375364
So as a workaround, I'm loading Astro file raw content with the good ol'
fs
😅Just a wild guess but maybe Astro itself is doing things BEFORE Vite does it's raw import. So it's not totally raw.
Environment is the same for local / CI (enforced in workflow and NPM project).
Maybe it's the Astro parser? Maybe macOS / Ubuntu would show difference?
Log extract:
I tried on stackblitz but I'm not able to reproduce this bug :(
Link to Minimal Reproducible Example
not able to reproduce it on stackblitz :(
Participation
The text was updated successfully, but these errors were encountered: