-
-
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
[Vue 2.7][vite] Custom blocks don't work in components that are written with Options API #218
Comments
+i have the same trouble :( |
|
You get another issue if you set bridge to true in the Vite plugin Uncaught TypeError: Cannot read properties of undefined (reading '__i18n') This also does not work (with $t)
P.S. I tried to create some unit tests in this repo to reproduce the problem but it looks like the tests are all running against Vue 3. I get it btw I have no idea how I would create a repo where I could test against two separate major releases. |
Thank you for your reporting! |
@kazupon hello! Is there any estimation of when this problem will be solved? |
Reporting a bug?
I'm using vite and vue 2.7 I have an SFC that looks like this:
The message from the custom i18n block doesn't get translated. In another component that uses script setup and composition API everything works fine
However global messages are seen from both components
Expected behavior
I expect that cusom i18n blocks will work with both Composition API and Options API
Reproduction
You can find the example here:
https://stackblitz.com/edit/vitejs-vite-sv4fcz?file=src%2FApp.vue,src%2FTest.vue,vite.config.js,src%2Fmain.js,package.json
Issue Package
unplugin-vue-i18n
System Info
Screenshot
No response
Additional context
vite plugin config looks like this:
And heere is how I create an instance of i18n:
Validations
The text was updated successfully, but these errors were encountered: