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
I'm using vue-i18n 9.10.2 and @intlify/unplugin-vue-i18n 4.0.0.
In a setup function of a vue component I've used useI18n().
In the template I wrote: {{ i18n.t('example') }}
If the translation key "example" is not defined or global defined, it works as expected.
But once I use a <i18n> block, I get the following error on SSR and ONLY on SSR. In the client it works as expected.
file:///mnt/project/apps/frontend/app/node_modules/@intlify/message-compiler/dist/message-compiler.node.mjs:78
const error = new SyntaxError(String(msg));
^
SyntaxError: Not support non-string message
at createCompileError (file:///mnt/project/apps/frontend/app/node_modules/@intlify/message-compiler/dist/message-compiler.node.mjs:78:19)
at createCoreError (file:///mnt/project/apps/frontend/app/node_modules/@intlify/core-base/dist/core-base.mjs:483:12)
at compileToFunction (file:///mnt/project/apps/frontend/app/node_modules/@intlify/core-base/dist/core-base.mjs:979:15)
at compileMessageFormat (file:///mnt/project/apps/frontend/app/node_modules/@intlify/core-base/dist/core-base.mjs:1284:17)
at translate (file:///mnt/project/apps/frontend/app/node_modules/@intlify/core-base/dist/core-base.mjs:1131:11)
at file:///mnt/project/apps/frontend/app/node_modules/vue-i18n/dist/vue-i18n.mjs:559:48
at wrapWithDeps (file:///mnt/project/apps/frontend/app/node_modules/vue-i18n/dist/vue-i18n.mjs:504:19)
at Proxy.t (file:///mnt/project/apps/frontend/app/node_modules/vue-i18n/dist/vue-i18n.mjs:559:16)
at eval (/mnt/project/apps/frontend/app/src/components/static/Account/AccountDevices.vue:97:77)
at Proxy.ssrRenderList (/mnt/project/apps/frontend/app/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:433:7)
at _sfc_ssrRender (/mnt/project/apps/frontend/app/src/components/static/Account/AccountDevices.vue:94:25)
at renderComponentSubTree (/mnt/project/apps/frontend/app/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:683:9)
at /mnt/project/apps/frontend/app/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:629:25
at processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 20,
domain: undefined
}
It doesn't matter which language I define for the block or if it is global.
Wondering why there is no ticket according this issue. How can you go wrong?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm using
vue-i18n 9.10.2
and@intlify/unplugin-vue-i18n 4.0.0
.In a setup function of a vue component I've used
useI18n()
.In the template I wrote:
{{ i18n.t('example') }}
If the translation key "example" is not defined or global defined, it works as expected.
But once I use a
<i18n>
block, I get the following error on SSR and ONLY on SSR. In the client it works as expected.It doesn't matter which language I define for the block or if it is global.
Wondering why there is no ticket according this issue. How can you go wrong?
These are the plugins in vite.config.ts:
I create the vue plugin with this code:
Beta Was this translation helpful? Give feedback.
All reactions