'Deploying a web app using Vite, I am unable to deploy the .js file. "<script src="/index.js"> in "/index.html" can't be bundled without type="module"

When Deploying a web app using Vite, I am unable to deploy the .js file. Getting the below issue.

$ vite build
vite v2.8.6 building for production...
**\<script src="/index.js"\> in "/index.html" can't be bundled without type="module" attribute**
transforming...

I cannot use in script type=module as I have no import of code to be done. If I use then error is coming.

If anyone can help.

I tried using script type=module but error is coming. Is there any way I can deploy with Vite without using type=module ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source