[BUG]: `events` is required but not declared in dependencies
維護者通常 1 天內回覆
@KoolADE85 已經在處理了。
開始於 2026年11月5日。
評估
- 難度
- 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 相依項目,且在嚴格安裝下成功完成 production build,即表示完成。
由索引模型根據 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 於 5 天前認領。 未關閉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 於 5 天前認領。 未關閉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 於 4 天前認領。 未關閉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
-
Windows flake: withFileLock throws EPERM when the previous holder's lock file is still being deleted未關閉
難度 2/5 1-3 小時 新手友好度 79/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 65/100
-
area: agent area: integration lane: strong-agent priority: P2 roadmap size: S type: integration type: task
難度 2/5 1-3 小時 新手友好度 74/100
arminazimi/seaworthy#688 ·
維護者通常 1 天內回覆
-
idea-scout idea:245
難度 2/5 1-3 小時 新手友好度 85/100
jeanibarz/agent-notebook#245 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
obsidianmd/obsidian-developer-docs#281 ·
維護者通常 4 天內回覆