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: 打包过程出错 #967

Closed
a1ooha opened this issue Dec 1, 2021 · 4 comments
Closed

Bug: 打包过程出错 #967

a1ooha opened this issue Dec 1, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@a1ooha
Copy link

a1ooha commented Dec 1, 2021

Versions

  • dumi: 1.1.33
  • node: 12.20.1
  • npm: 7.20.2
  • OS: macOS Monterey
  • Browser: Chrome 94.0.4606.81

Steps to reproduce

使用了 https://replit.com/@moudy/codemirror6-test 里的代码,但在 dumi 里 npm start 时会报错,但 npm run build 不会报错。

.fatherrc.ts 的配置是:

export default {
  esm: 'rollup',
  // cjs: 'rollup',
  runtimeHelpers: true,
};

可复现 repo:https://github.com/a1ooha/react-codemirror

What is Expected?

在项目里直接 wepback 打包上面的代码是正常的,所以代码应该没问题。

What is actually happening?

compile 过程报错:

image

@a1ooha a1ooha added the bug Something isn't working label Dec 1, 2021
@a1ooha a1ooha changed the title bug: Bug: 打包过程出错 Dec 1, 2021
@PeachScript
Copy link
Member

在项目里直接 wepback 打包上面的代码是正常的

找一下项目的 webpack 配置,大概率要额外挂某些 babel 插件,或者 babel-loader 的配置和 Umi 默认的不一样,可以 chainWebpack 修改

@a1ooha
Copy link
Author

a1ooha commented Dec 17, 2021

是 @babel/preset-env 里的 @babel/plugin-proposal-unicode-property-regex 的 bug, babel/babel#13815

@a1ooha
Copy link
Author

a1ooha commented Dec 17, 2021

直接使用 umi 打包也是正常的

@jo0ger
Copy link

jo0ger commented Aug 4, 2023

@a1ooha 怎么解决呢?我也遇到了这个问题

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

3 participants