Md. Helal Uddin
Md. Helal Uddin

Reputation: 2323

getting error on vite build in vue3 vite project

I have prepared my vue3 project with vite. In localhost, if I run npm run dev it is working properly and running the website file. If I run npm run build then it is not working. I have attached the error message as an image. Please check

TIA

enter image description here

Upvotes: 0

Views: 6149

Answers (1)

Md. Helal Uddin
Md. Helal Uddin

Reputation: 2323

In some npm packages, I have used in my project have some features were added from the latest EcmaScript. Like async generator functions, for-await, etc. Vite used the esbuild library to bundle javascript. If we don’t set the target, the transform by esbuild doesn’t work properly. To solve this issue need to set a target in the build command (package.json)

vite build --target=es2020

Upvotes: 2

Related Questions