I am used to judging the packaging status according to process
in config
. This upgrade to vue3
encountered an error
for the solution, configure vite.config.json
add the following configuration.
export default defineConfig({
// ...
define: {
'process.env': process.env
}
})
Read More:
- [Solved] Vue3 Error: Cant find variable: GlobalThis
- [Solved] vite package Error: globalThis is not defined
- [Solved] Vite packing error: some chunks are larger than 500kb after minification
- [Solved] Some chunks are bigger warning on vite packaging
- After Vite starts, it will prompt “network: use ` — host ` to expose”, and the service cannot be accessed through network IP
- [Solved] Temporary error: Error: spawn E:\vue3-vite\my-app\node_modules\esbuild\esbuild.exe ENOENT
- [Solved] Component name “login“ should always be multi-word.
- [Solved] Error: Transform failed with 1 error: error: Invalid option in transform() call: “jsx“
- [Solved] Vue unit test syntax error: unexpected token ‘export‘
- How to Solve JS error: Unexpected end of JSON input,Unexpected token u in JSON at position 0
- [Solved] VS Code Error: Vetur can‘t find ‘tsconfig.json‘ or ‘jsconfig.json‘
- Vue2.0: How to Use vue3 api to encapsulate Axios
- [Solved] Vuepress Package Error: document is not defined
- package.json Scripts configuration environment variable distinguishes development environment from production environment
- Vue-cli2 sub environment packaging
- npm ERR code ELIFECYCLE [How to Solve]
- The vue3 project Error: Cannot find module’vue-loader-v16/package.json’
- [Solved] electron project Package Error: spawn exe\dll ENOENT
- [Solved] Prittier format code error: JSON Error in…
- [Solved] Install The Latest Version of Jest Error: TypeError: Cannot read property ‘instrument‘ of undefined