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

🐛 项目运行时,@antv/[email protected] 内部报错 #3025

Closed
3 tasks
oliver34 opened this issue Dec 10, 2024 · 6 comments · Fixed by #3026
Closed
3 tasks

🐛 项目运行时,@antv/[email protected] 内部报错 #3025

oliver34 opened this issue Dec 10, 2024 · 6 comments · Fixed by #3026
Assignees

Comments

@oliver34
Copy link

🏷 Version

Package Version
@antv/s2 2.1.2
@antv/s2-react 2.1.2
@antv/s2-vue

Sheet Type

  • [ ✅] PivotSheet
  • [打钩 ] TableSheet
  • GridAnalysisSheet
  • StrategySheet
  • EditableSheet

🖋 Description

项目环境:umi3.0 + React 17
之前使用 1.0 版本,没有报错,最近想升级一下 2.0 版本,处理了一些兼容报错问题,但是项目运行后 @antv/s2-react 内部报错了,然后 尝试直接从 dist 引入也是一样报错,报错截图如下,是打包工具太老了需要升级吗

⌨️ Code Snapshots

🔗 Reproduce Link

image

🤔 Steps to Reproduce

😊 Expected Behavior

😅 Current Behavior

💻 System information

Environment Info
System
Browser
@oliver34
Copy link
Author

oliver34 commented Dec 10, 2024

我在配置中将包引用强制指向了 cjs 构建产物

alias: {
    '@antv/s2-react': '@antv/s2-react/dist/s2-react.min.js', 
  },

报错少了,但是还是报了一个错

ERROR in ./node_modules/_@[email protected]@@antv/s2-react/dist/s2-react.min.js
Module not found: Error: Can't resolve '@antv/s2/extends' in '/Users/wangjunjie/Desktop/hmos/hmos-report-solution/node_modules/_@[email protected]@@antv/s2-react/dist'
 @ ./node_modules/_@[email protected]@@antv/s2-react/dist/s2-react.min.js 26:113-140
 @ ./src/index.ts

@lijinke666

@lijinke666
Copy link
Member

lijinke666 commented Dec 11, 2024

我在配置中将包引用强制指向了 cjs 构建产物

你引的是 umd, 不要为了不报错乱搞...


esm 编译的 target 是 ESNext, 所以没处理 ??= ?? 之类的语法, 你的打包工具应该是忽略了 node_modules, 所以没编译, 导致 webpack 不识别这个语法

这个我优化下, 把构建产物编译到 es2015 好了

@lijinke666
Copy link
Member

🎉 This issue has been resolved in version @antv/s2-v2.1.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lijinke666
Copy link
Member

🎉 This issue has been resolved in version @antv/s2-vue-v2.0.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lijinke666
Copy link
Member

🎉 This issue has been resolved in version @antv/s2-react-v2.1.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lijinke666
Copy link
Member

🎉 This issue has been resolved in version @antv/s2-react-components-v2.1.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

2 participants