-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@vitejs/plugin-legacy doesn't work on ie11, the script isn't executed and it isn't transpiled. #6577
Comments
Do you use |
|
|
so no Hmr mode ? |
Vite provides fast dev env in the modern browsers, but not in IE11. |
The documentation doesn't make this clear enough. The very first line of the documentation should say this in bold letters:
|
Describe the bug
I am trying to run my application on IE 11, it's using react and typescript, but the transpiled scripts do not work at all.
The index.html page is loaded but it stays blank with and the script doesn't run.
I have setup a vanilla vite app to see if it was my React+Typescript setup and the problem also happens in the vanilla app, which I liked in the repo.
I also put an
alert
in the js to see if that would fire, but nothing happened, I also have no errors on the console.The HTML file is loaded though:
The script file seems to have been downloaded even though it wasn't executed.
Also, I'm pretty sure IE11 wouldn't like
import './style.css';
or the template string if the script was running.I used the default vite.config.js from @vitejs/plugin-legacy for this:
Removing
type="module"
from the script tag seems to allow the script to run but I don't know if it's a good idea to do that because I'm not too sure if vite needs that for any reason.Also, as suspected, even though the script runs, I get syntax errors due to the code not being transpiled to js that is compatible with IE 11.
I don't know what to do here, any help is appreciated.
Thanks in advance.
Reproduction
https://github.com/ericmackrodt/vitejs-vite-wgu8t4
System Info
Used Package Manager
yarn
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: