在Vue中使用顶级await,打包出现报错的解决方案

03-27 阅读 0评论

报错信息

 error during build:

在Vue中使用顶级await,打包出现报错的解决方案,在Vue中使用顶级await,打包出现报错的解决方案,词库加载错误:未能找到文件“C:\Users\Administrator\Desktop\火车头9.8破解版\Configuration\Dict_Stopwords.txt”。,使用,解决方案,第1张
(图片来源网络,侵删)

    Error: Transform failed with 1 error:

   assets/alarmStrategy-!~{00m}~.js:315:12: ERROR: Top-level await is not available in the    configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari14" + 2 overrides)

解决方案 :在vite.config.js中添加以下代码

export default defineConfig({
  plugins: [vue()],
  build:{
    target:['edge90','chrome90','firefox90','safari15']
  }
}

主要代码 打包错误在 build { }里面添加 

target: ['edge90', 'chrome90', 'firefox90', 'safari15'],
或者
build: {
    target: "es2019",
}
或者
build: {
    target: "esnext",
}
在Vue中使用顶级await,打包出现报错的解决方案,在Vue中使用顶级await,打包出现报错的解决方案,词库加载错误:未能找到文件“C:\Users\Administrator\Desktop\火车头9.8破解版\Configuration\Dict_Stopwords.txt”。,使用,解决方案,第2张
(图片来源网络,侵删)
在Vue中使用顶级await,打包出现报错的解决方案,在Vue中使用顶级await,打包出现报错的解决方案,词库加载错误:未能找到文件“C:\Users\Administrator\Desktop\火车头9.8破解版\Configuration\Dict_Stopwords.txt”。,使用,解决方案,第3张
(图片来源网络,侵删)

免责声明
本网站所收集的部分公开资料来源于AI生成和互联网,转载的目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。
文章版权声明:除非注明,否则均为主机测评原创文章,转载或复制请以超链接形式并注明出处。

发表评论

快捷回复: 表情:
评论列表 (暂无评论,人围观)

还没有评论,来说两句吧...

目录[+]