Skip to content
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

[Bug] browserslist 包中 require.resolve 报错 #10356

Closed
vagusX opened this issue Jan 31, 2023 · 1 comment · Fixed by #10396
Closed

[Bug] browserslist 包中 require.resolve 报错 #10356

vagusX opened this issue Jan 31, 2023 · 1 comment · Fixed by #10396
Assignees

Comments

@vagusX
Copy link

vagusX commented Jan 31, 2023

What happens?

在 @umijs/deps 3.5.36 对应文件 node_modules/@umijs/deps/compiled/babel/bundle.js 中
image

对应的 require.resolve 关键字的 require 被指向了空模块

image

对应的 browserlist 的源码如下

https://github.com/browserslist/browserslist/blob/main/node.js#L176

会导致 使用 extends 方式拓展的 browserslist 配置 会报错,因为 require.resolve 的 require 是一个空模块

Mini Showcase Repository(REQUIRED)

https://github.com/vagusX/umi-browserslist-extends-bug-sample

How To Reproduce

Steps to reproduce the behavior:

git clone https://github.com/vagusX/umi-browserslist-extends-bug-sample
yarn
yarn start

出现以下报错

image

Expected behavior
正常运行不报错

Context

  • Umi Version: 3.5.36
  • Node Version: v16.14.2
  • Platform: macos
@vagusX vagusX changed the title [Bug] say something [Bug] browserslist 包中 require.resolve 报错 Jan 31, 2023
@vagusX
Copy link
Author

vagusX commented Jan 31, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants