Top-level|Top-level await is not available in the configured target...
Vite2打包报 Top-level await is not available in the configured target environment
直接上方案
【Top-level|Top-level await is not available in the configured target...】在vite.config.ts的加上下面
build: {
target: "es2019",
}
或者
build: {
target: "esnext",
}
或者
build: {
target: ['edge90','chrome90','firefox90','safari15','esnext'],
}
推荐阅读
- React报错之`value` prop on `input` should not be null
- React报错之`value`|React报错之`value` prop on `input` should not be null
- 《告别Bug》|TypeError(List indices must be integers or slices , not str)
- 深度学习|Jupyter Notebook(Anaconda)——两个环境分别修改默认打开目录(深度学习第一周番外篇)
- ARC129E|ARC129E Yet Another Minimization 题解 【网络流笔记】
- React报错之Objects are not valid as a React child
- React报错之Objects|React报错之Objects are not valid as a React child
- Java中NoClassDefFoundError|Java中NoClassDefFoundError 和 ClassNotFoundException的区别
- 简年14(蚂蚁笔记(Leanote)快速部署指南)
- React报错之map() is not a function