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

Failed to package @antv/my-f2 in DingTalk custom component #1494

Closed
1 task
xiaoyierle opened this issue May 21, 2022 · 3 comments
Closed
1 task

Failed to package @antv/my-f2 in DingTalk custom component #1494

xiaoyierle opened this issue May 21, 2022 · 3 comments

Comments

@xiaoyierle
Copy link

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

https://github.com/xiaoyierle/ding-component-demo.git

Steps to reproduce

  1. The current application is the DingTalk applet application
  2. Develop through small program development tools
  3. Error when packing

"@antv/my-f2": "^2.1.7" will have problems, 2.1.4 will be fine

Error when compressing code, please check if ES6 syntax is used in node_modules, ES6 code will cause iOS9/iOS10 runtime white screen

Error location: /tmp/data/onetime_tmp_dir/976174aa-addf-495f-b1eb-12fef4ae5593-1653099623859/tiny-ZpiEFs6od-1653099623890/main/index.worker.js:1763:313
Error message: ./plugin/node_modules/@antv/f2/node_modules/@antv/adjust/lib/symmetric.js
@antv/util/lib/array/merge not found, please check package.json configuration and try to reinstall node_modules dependencies
Module not found: Can't resolve '@antv/util/lib/array/merge' in '/tmp/data/build/plugin/node_modules/@antv/f2/node_modules/@antv/adjust/ lib'

./plugin/node_modules/@antv/f2/node_modules/@antv/adjust/lib/symmetric.js
@antv/util/lib/math/max-by not found, please check package.json configuration and try to reinstall node_modules dependencies
Module not found: Can't resolve '@antv/util/lib/math/max-by' in '/tmp/data/build/plugin/node_modules/@antv/f2/node_modules/@antv/ adjust/lib'

./plugin/node_modules/@antv/f2/node_modules/@antv/adjust/lib/stack.js
@antv/util/lib/type/is-array not found, please check package.json configuration and try to reinstall node_modules dependencies
Module not found: Can't resolve '@antv/util/lib/type/is-array' in '/tmp/data/build/plugin/node_modules/@antv/f2/node_modules/@antv/ adjust/lib'

./plugin/node_modules/@antv/f2/node_modules/@antv/adjust/lib/symmetric.js
@antv/util/lib/type/is-array not found, please check package.json configuration and try to reinstall node_modules dependencies
Module not found: Can't resolve '@antv/util/lib/type/is-array' in '/tmp/data/build/plugin/node_modules/@antv/f2/node_modules/@antv/ adjust/lib'

./plugin/node_modules/@antv/f2/node_modules/@antv/adjust/lib/stack.js
@antv/util/lib/type/is-nil not found, please check package.json configuration and try to reinstall node_modules dependencies
Module not found: Can't resolve '@antv/util/lib/type/is-nil' in '/tmp/data/build/plugin/node_modules/@antv/f2/node_modules/@antv/ adjust/lib'

index.worker.js from UglifyJs
Unexpected token: operator «*», expected: punc «(» [index.worker.js:1763,313]
Repair method: According to the error message, find the module containing ES6 syntax in node_modules
1. Contact the module developer to release the corresponding ES5 version, or try to update the dependencies (recommended)
2. Create a new mini.project.json in the root directory of the applet, add the module to the whitelist, for example:
{
"node_modules_es6_whitelist": [
"mod1",
"@alipay/mod2"
]
}
means node_modules/mod1, node_modules/@alipay/mod2 2 modules will do babel ES6->ES5 conversion

Environment Info
f2 4.0.20
System MAC OS 12.3.1
Browser chrome 101.0.4951.64(正式版本) (x86_64)

Is it possible to solve this babel conversion problem from the code level?

@zengyue
Copy link
Member

zengyue commented May 21, 2022

这个看起来是钉钉小程序的构建问题吧?如果是新项目,建议用最新的 4.0 的版 https://f2.antv.vision/zh/docs/tutorial/miniprogram/

@xiaoyierle
Copy link
Author

好的,了解~新版更新下依赖应该就可以了

@zengyue
Copy link
Member

zengyue commented May 24, 2022

好的,了解~新版更新下依赖应该就可以了

@antv/f2@4.0.21 试下这个版本,看看还有没问题

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

Successfully merging a pull request may close this issue.

2 participants