Compilation Error in Vite Project: Scripts without "type" attribute are enforced as modules #16671
Fran-Romar
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm encountering an issue while compiling my Vite project. During development, I was able to add scripts to my index.html without the "type" attribute. However, when running npm run build, Vite is enforcing me to add the type="module" attribute to these scripts in the HTML. The problem lies in the fact that these scripts are not modules, thus this enforcement causes errors during compilation. I've checked Vite's configuration and haven't found any option controlling this behavior. How can I prevent Vite from forcing scripts as modules during compilation? Any help or suggestions to resolve this issue would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions