Skip to content
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

Conversation

userquin
Copy link
Member

resolves #420

@userquin userquin changed the title fix: check for vue compiler in directive transform hook fix(unplugin-vue-i18n): check for vue compiler in directive transform hook Nov 16, 2024
vuePluginOptions,
translationIdentifiers
)
}
Copy link
Member Author

@userquin userquin Nov 16, 2024

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?

Copy link
Member

@kazupon kazupon Nov 17, 2024

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)

Copy link
Member Author

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?

@userquin
Copy link
Member Author

closing this, it is a bug in @vitejs/plugin-vue, compiler not being initialized correctly: vitejs/vite-plugin-vue#475

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

error when running Nuxt I18n module with latest Nuxt version (π version) in StackBlitz
2 participants