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 SSR and the vue-i18n causing an error when running the render server.
But it's all OK when running in the browser.
After reading the source code, I find that the vue-i18n cannot get the vue instance.
According to the backtrace, I modify the source code to provide more debug information:
in @vue/runtime-core/runtime-core.cjs.js:6649:
beforeCreate(){constinstance=vue.getCurrentInstance();console.log("in vue-i18n");console.log(instance);/* istanbul ignore if */if(!instance){throwcreateI18nError(22/* UNEXPECTED_ERROR */);}
So I got this output:
in vue
<ref *2> {
uid: 0,
vnode: {
__v_isVNode: true,
__v_skip: true,
type: { __ssrInlineRender: true, setup: [Function: setup] },
// ......
ssrRender: [Function (anonymous)]
}
in vue-i18n
null
[Vue warn]: Unhandled error during execution of beforeCreate hook
at <Anonymous>
SyntaxError: 22
at Module.createCompileError (/home/zapic/project/dist/server/js/webpack:/mcbbs_vue/node_modules/@intlify/message-compiler/dist/message-compiler.esm-bundler.js:32:1)
at createI18nError (/home/zapic/project/dist/server/js/webpack:/mcbbs_vue/node_modules/vue-i18n/dist/vue-i18n.cjs.js:38:1)
at Proxy.beforeCreate (/home/zapic/project/dist/server/js/webpack:/mcbbs_vue/node_modules/vue-i18n/dist/vue-i18n.cjs.js:1354:1)
at callWithErrorHandling (/home/zapic/project/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:6652:36)
at callWithAsyncErrorHandling (/home/zapic/project/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:6661:21)
at callHook (/home/zapic/project/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:2263:5)
at applyOptions (/home/zapic/project/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:2030:9)
at finishComponentSetup (/home/zapic/project/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:6390:9)
at handleSetupResult (/home/zapic/project/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:6335:5)
at setupStatefulComponent (/home/zapic/project/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:6298:13) {
code: 22,
domain: undefined
}
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 SSR and the vue-i18n causing an error when running the render server.
But it's all OK when running in the browser.
After reading the source code, I find that the vue-i18n cannot get the vue instance.
According to the backtrace, I modify the source code to provide more debug information:
in
@vue/runtime-core/runtime-core.cjs.js:6649
:in
vue-i18n/vue-i18n.cjs.js:1348
:So I got this output:
System Info:
Beta Was this translation helpful? Give feedback.
All reactions