Use the top-level await in Vue to generate an error reporting solution
1. Version information
vue:3.2.16
vite:2.6.4
node:17.1.0
2. Error message
error during build:
Error: Transform failed with 1 error:
assets/index.867f4832.js:187:9: error: Top-level await is not available in the configured target environment ("chrome87", "edge88", "es2019", "firefox78", "safari13.1")
3. Solution
Add the following code in vite.config.js
export default defineConfig({
plugins: [vue()],
build:{
target:['edge90','chrome90','firefox90','safari15']
}
})
Similar Posts:
- Solve the problem of JS using JSX syntax to report errors in vite react project
- Uncaught DOMException: Blocked a frame with origin “null” from accessing a cross-origin…
- [Solved] Vite build Error: Expected a JavaScript module script but the server responded with a MIME type.
- [Solved] Vue3 vite Error: Uncaught ReferenceError: require is not defined
- Summary of internationally renowned CSS Reset
- The influence of UVM environment on UVM_ config_ Understanding of DB
- [Solved] Vue cli 3.0 error: “Failed to load resource: net::ERR_FILE_NOT_FOUND”
- remove-weknow-ac from mac chrome
- You have not completed the merge: You have not concluded your merge (MERGE_HEAD exists)
- [Solved] Could not get BatchedBridge, make sure your bundle is packaged correctly