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

编译后预览报错 #9

Open
cs-xiao opened this issue Oct 31, 2022 · 6 comments
Open

编译后预览报错 #9

cs-xiao opened this issue Oct 31, 2022 · 6 comments

Comments

@cs-xiao
Copy link

cs-xiao commented Oct 31, 2022

SyntaxError: 19 (at index.10dbab0b.js:39:542)
at createCompileError (index.10dbab0b.js:39:542)
at createI18nError (index.10dbab0b.js:53:936)
at useI18n (index.10dbab0b.js:53:22093)
at setup (index.c90c7eca.js:1:14601)
at callWithErrorHandling (index.10dbab0b.js:4:789)
at setupStatefulComponent (index.10dbab0b.js:4:51147)
at setupComponent (index.10dbab0b.js:4:50800)
at Ve (index.10dbab0b.js:4:35166)
at oe (index.10dbab0b.js:4:35012)
at w (index.10dbab0b.js:4:31254)

@anaf007
Copy link

anaf007 commented Nov 5, 2022

我的一切正常 改改后 现在用在项目上了 还算OK

@tjlizz
Copy link

tjlizz commented Nov 21, 2022

同样的问题
image

复现步骤


git clone https://github.com/hu-snail/vue3-admin-element-template.git


cd .\vue3-admin-element-template\


pnpm i


pnpm run  build


pnpm run preview

@IWANTSLEEP1
Copy link

SyntaxError: 19 (at index.10dbab0b.js:39:5
怎么解决的,我也是这个问题

@cs-xiao
Copy link
Author

cs-xiao commented Jan 4, 2023

SyntaxError: 19 (at index.10dbab0b.js:39:5
怎么解决的,我也是这个问题

不使用18n组件

@YixinZhou
Copy link

确实是18n组件的问题,在18n插件中添加legacy:false即可。
src\locales\index.js文件中修改:
const i18n = createI18n({
legacy: false,
locale: getLocale(),
messages: messages,
});
成功解决问题。

@leeweather
Copy link

跟i18n版本有一定关系,package.json中

 "dependencies": {
    "vue-i18n": "^9.1.10",
  },

master中仅存在yarn.lock,而无其他lock文件,所以在使用除yarn以外的工具(例如npm,pnpm等)安装依赖时,会安装9.x.x版本的最新版i18n,导致preview报错,build后白屏等问题
解决办法1:

  • 9.2.2以上版本的i18n,配置legacy: false

解决办法2:

  • package.json中"vue-i18n": "^9.1.10"修改为"vue-i18n": "9.1.10",锁定版本,重新安装依赖

参考:https://github.com/intlify/vue-i18n-next/issues/1193

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

No branches or pull requests

6 participants