Home > OS >  How to ignore warning "script[type=module]' is not supported by Internet Explorer"?
How to ignore warning "script[type=module]' is not supported by Internet Explorer"?

Time:02-20

In the HTML below, the line <script type="module" src="/src/main.tsx"></script> gives me a warning:

'script[type=module]' is not supported by Internet Explorer.Microsoft Edge Tools (compat-api/html)'

I've no intention of supporting IE11. I'm using VSCode Version: 1.64.2. How can I ignore this warning?

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" type="image/svg xml" href="/src/favicon.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Vite App</title>
  </head>
  <body>
    <div id="root"></div>
    <script>
      window.global = window;
      window.process = {
        env: { DEBUG: undefined },
      };
      var exports = {};
    </script>
    <script type="module" src="/src/main.tsx"></script>
  </body>
</html>

CodePudding user response:

Based on the error source (compat-api/html), I assume you're using Webhint.

That rule supports configuring the supported browser list in .hintrc, so you could configure it to exclude Internet Explorer:

// .hintrc
{
    "browserslist": [
        "defaults",
        "not IE 11",
        ⋮
    ]
}
  • Related