-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(i18n): use define
to deliver config to virtual module
#9838
Conversation
🦋 Changeset detectedLatest commit: 288128f The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not my favorite solution, but if it works, it works!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a test? As far as I understood, there was a way to reproduce it
The error happens on dev startup, during some work being performed by a plugin called vite:dep-scan. It would be simpler if it happened on request. I'm not confident a test can catch but I'll take a look. |
No luck. The fact that a fetch request itself will succeed with expected html aside, the bug won't even happen in our monorepo. It seems to be one of these cases where vite is sensitive to whether astro is linked or copied to node_modules. |
Thank you for taking the time to explain and double check. |
Can you explain how this fixes the issue? Using EDIT: I missed your message that it happen in |
AFAIK, it will not appear on import.meta.env. |
I'm guessing astro-env-inject picks it up. |
define
to deliver config to virtual module
Vite would use |
I didn't know that, thanks! |
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
Changes
astro:i18n
module.Testing
Existing tests should pass.
Docs
Does not affect usage.