-
-
Notifications
You must be signed in to change notification settings - Fork 37
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(unplugin-vue-i18n): check for vue compiler in directive transform hook #421
fix(unplugin-vue-i18n): check for vue compiler in directive transform hook #421
Conversation
vuePluginOptions, | ||
translationIdentifiers | ||
) | ||
} |
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.
should we set vuePluginOptions
to null
if missing compiler?
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.
Ah, yeah!
vue-i18n directive does not work without Vue compiler for SSR.
if Vue compiler is not specify on vitejs/plugin-vue
, unplugin-vue-i18n
should output warning.
(I recognize vitejs/plugin-vue
has Vue compiler as default)
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.
Oh that's true, it is about the v-t directive, I'm going to check if ssr is exposed.
If this is only a vite plugin why not just expose the transform hook inside vite?
closing this, it is a bug in @vitejs/plugin-vue, compiler not being initialized correctly: vitejs/vite-plugin-vue#475 |
@kazupon @BobbieGoede looks like Vite Vue plugin PR will take some time, I guess we can use the protection in this PR to avoid the error in Nuxt calling Vite warmup. |
I agree we probably need to skip transform if the compiler is unset, it seems like both devtools ( Related nuxt-modules/i18n#3241 |
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.
LGTM!
resolves #420