[BUG]: `events` is required but not declared in dependencies
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 83/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- javascript, webpack
- 领域
- build-system, frontend
调研方向
首先阅读 package.json 和报告中提到的三个文件:src/lib/events.js、src/snapshot/toimage.js 和 src/snapshot/svgtoimg.js。使用提供的严格 pnpm install 和 webpack 命令复现故障。当包声明了所需的 events 依赖项,并且在严格安装下生产构建成功时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Description
src/lib/events.js, src/snapshot/toimage.js and src/snapshot/svgtoimg.js call require('events'), but events is not in the dependencies of package.json.
Since webpack 5 no longer polyfills Node.js core modules, the bundler resolves events to whatever version the package manager happens to hoist.
Today, it only resolves through a transitive dependency: regl-scatter2d → glslify → glslify-deps → events.
With strict installs (pnpm with hoist=false, Yarn PnP), the build fails.
With hoisted installs, another package's events can be picked up instead (e.g. [email protected]).
This happens with the latest release (4.2.0) and with 2.x.
events is the only Node.js core module still required under src/ (see also #6014 for older ones).
Steps to reproduce
package.json:
{
"dependencies": { "plotly.js": "4.2.0" },
"devDependencies": { "webpack": "5.106.0", "webpack-cli": "6.0.1" }
}
src/index.js:
import Plotly from "plotly.js/lib/core";
console.log(Plotly.version);
pnpm install --config.hoist=false
npx webpack --mode production
ERROR in ./node_modules/.pnpm/[email protected]/node_modules/plotly.js/src/lib/events.js 3:19-49
Module not found: Error: Can't resolve 'events' in '.../node_modules/.pnpm/[email protected]/node_modules/plotly.js/src/lib'
- 主要语言
- JavaScript
- 星标
- 18.4k
- 派生
- 2.1k
- 平均合并
- 1 天 3 小时
- 30 天内合并 PR
- 9
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
plotly/plotly.js 的其他 Issue
-
[BUG]: `sankey`: `node.x` / `node.y` of `0` is ignored可能已有人在做 @adimalkar 于 4 天前认领。 未关闭bug P3 size: 1
难度 2/5 1-3 小时 新手友好度 75/100
plotly/plotly.js#8150 · 1 条评论 ·
维护者通常 1 天内回复
-
[BUG]: `scatterpolargl` drops points between 10000 and 100000 points可能已有人在做 @Tanishdete333 于 4 天前认领。 未关闭bug P3 size: 1
难度 2/5 1-3 小时 新手友好度 82/100
plotly/plotly.js#8148 · 1 条评论 ·
维护者通常 1 天内回复
-
[BUG]: findEmpties throws "iterated with no new neighbors" for large NaN regions in contour (double-precision underflow)可能已有人在做 @davrens101 于 3 天前认领。 未关闭bug P3 size: 3
难度 2/5 1-3 小时 新手友好度 86/100
plotly/plotly.js#8108 · 4 条评论 ·
维护者通常 1 天内回复
-
chore P3 plotly-internal size: 3 task
难度 2/5 1-3 小时 新手友好度 77/100
plotly/plotly.js#8064 · 1 条评论 ·
维护者通常 1 天内回复
-
chore P1 plotly-internal size: 1 task
难度 1/5 1 小时以内 新手友好度 82/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
processing/p5.sound.js#132 ·
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
jellyfin/jellyfin-web#8791 ·
维护者通常 1 天内回复
-
bug triage
难度 1/5 1 小时以内 新手友好度 68/100
fjaeckel/seriesoftubes#306 ·
维护者通常 1 天内回复
-
ai bug good first issue
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 73/100
hugomrdias/playwright-test#753 ·
维护者通常 1 天内回复