vue3-admin-element-template icon indicating copy to clipboard operation
vue3-admin-element-template copied to clipboard

编译后预览报错

Open cs-xiao opened this issue 2 years ago • 6 comments

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)

cs-xiao avatar Oct 31 '22 06:10 cs-xiao

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

anaf007 avatar Nov 05 '22 19:11 anaf007

同样的问题 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

tjlizz avatar Nov 21 '22 09:11 tjlizz

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

IWANTSLEEP1 avatar Dec 30 '22 03:12 IWANTSLEEP1

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

不使用18n组件

cs-xiao avatar Jan 04 '23 11:01 cs-xiao

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

YixinZhou avatar Apr 04 '23 09:04 YixinZhou

跟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

leeweather avatar May 07 '23 04:05 leeweather