You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please provide a link to a repo that can reproduce the problem you ran into. A minimal reproduction is required (Why?). If a report is vague (e.g. just a generic error message) and has no reproduction, it will receive a "Status: Need More Info" label. If no reproduction is provided after 5 days, it will be closed.
We had the same problem migrating our application to vue-i18n composition mode together with @intlify/unplugin-vue-i18n.
It seems like there is some incompatibility between [email protected]+ and @intlify/[email protected]. As you can see, your return value from t is an AST-object. While the unplugin precompiles your messages to AST objects, the JIT compilation in vue-i18n is disabled by default (or maybe the other way around 😅).
The easiest solution is to update vue-i18n to 10.x. If this is not possible here is a guide to activate JIT compilation for different bundlers:
@kazupon IMO the documentation is not clear that the __INTLIFY_JIT_COMPILATION__ feature flag must be activated when using the unplugin together with [email protected]+
Reporting a bug?
ussing t function in composition API returns error.
tm(
summer):
{ "type": 0, "start": 0, "end": 6, "loc": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 7, "offset": 6 }, "source": "Summer" }, "body": { "type": 2, "start": 0, "end": 6, "loc": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 7, "offset": 6 } }, "items": [ { "type": 3, "start": 0, "end": 6, "loc": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 7, "offset": 6 } } } ], "static": "Summer" } }
te('summer')
true
t('summer')
SyntaxError: Unexpected return type in composer
Expected behavior
function t should work
Reproduction
vite.config.js
app.js
Show.vue
Issue Package
vite-plugin-vue-i18n
System Info
Screenshot
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: