按照antv-f2文档中的按需引用会出现查找文件失败的错误
- Dominant language
- JavaScript
- Stars
- 8k
- Forks
- 637
- PR merge metrics
- No merged PRs in 30d
Description
最新3.8.1版本
09:48:23.073 文件查找失败:'@antv/util/lib/array/merge' at node_modules/@antv/adjust/lib/symmetric.js:10
09:48:23.073 文件查找失败:'@antv/util/lib/math/max-by' at node_modules/@antv/adjust/lib/symmetric.js:5
09:48:23.084 文件查找失败:'@antv/util/lib/type/is-array' at node_modules/@antv/adjust/lib/stack.js:3
09:48:23.084 文件查找失败:'@antv/util/lib/type/is-array' at node_modules/@antv/adjust/lib/symmetric.js:7
09:48:23.095 文件查找失败:'@antv/util/lib/type/is-nil' at node_modules/@antv/adjust/lib/stack.js:5
09:48:23.281 ERROR Build failed with errors.
看了一下是引入的工具函数目录@antv/util/lib下没有type这个文件夹
var isArray = require('@antv/util/lib/type/is-array')
var maxBy = require('@antv/util/lib/math/max-by')
例如像下面这样引用都会报错
const F2 = require('@antv/f2/lib/index-all');
const F2 = require('@antv/f2/lib/index'); // 建议统一从 lib 下引入
const PieLabel = require('@antv/f2/lib/plugin/pie-label'); // 引入 PieLabel 模块
F2.Chart.plugins.register(PieLabel);
Contributor guide
Research direction
Reproduce the failure with F2 3.8.1 and the documented on-demand imports, especially lib/index, lib/index-all, and lib/plugin/pie-label. Start with the failing requires in node_modules/@antv/adjust/lib/symmetric.js and stack.js and inspect the available @antv/util/lib paths. Done means the documented imports build without file-not-found errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100