Skip to content

[Bug]: 无法兼容ie11 #6901

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

Open
taokouzi opened this issue Mar 3, 2025 · 4 comments
Open

[Bug]: 无法兼容ie11 #6901

taokouzi opened this issue Mar 3, 2025 · 4 comments
Labels
💉 bug Something isn't working

Comments

@taokouzi
Copy link

taokouzi commented Mar 3, 2025

Version

System:
    OS: Windows 10 10.0.19045
    CPU: (12) x64 Intel(R) Core(TM) i5-10400 CPU @ 2.90GHz
    Memory: 12.57 GB / 31.82 GB
  Browsers:
    Edge: Chromium (131.0.2903.99)
    Internet Explorer: 11.0.19041.4355

Details

不兼容ie11浏览器,是哪里配置没对还是啥原因呢?

Reproduce link

https://github.com/taokouzi/modernjs-test

Reproduce Steps

1、pnpm install
2、pnpm dev

http://localhost:8080/landing-page

@taokouzi taokouzi added the 💉 bug Something isn't working label Mar 3, 2025
@zllkjc
Copy link
Member

zllkjc commented Mar 3, 2025

具体出现了什么错误呢,可以提供一些截图

@taokouzi
Copy link
Author

taokouzi commented Mar 4, 2025

具体出现了什么错误呢,可以提供一些截图

错误如下:

image

配置如下:

``.babelrc``

{
  "presets": [
    [
      "@babel/preset-env",
      {
        "targets": {
          "browsers": ["ie >= 11"]
        },
        "useBuiltIns": "usage",
        "corejs": 3
      }
    ]
  ],
  "include": ["node_modules/*"]
}
`` .browserslistrc``

> 0.5%
not dead
IE 11
``package.json``

"dependencies": {
  ......
    "core-js": "^3.41.0",
    "regenerator-runtime": "^0.14.1"
 ......
}
``polyfill.ts``

import 'core-js/stable';
import 'regenerator-runtime/runtime';

代码demo地址:

https://github.com/taokouzi/modernjs-test

pnpm install
pnpm dev

运行在  http://localhost:8080/landing-page

@zllkjc 麻烦看下呢

@zllkjc
Copy link
Member

zllkjc commented Mar 4, 2025

可以尝试移除 modern.config.ts 中 polyfill 配置,验证是否能正常运行。

@taokouzi
Copy link
Author

taokouzi commented Mar 5, 2025

可以尝试移除 modern.config.ts 中 polyfill 配置,验证是否能正常运行。

试了,还是不行呢~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💉 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants