Uncaught TypeError: Cannot destructure property `textNodes` of 'undefined' or 'null'.
- 主要語言
- CoffeeScript
- 星號
- 518
- 分支
- 70
- PR 合併指標
- 30 天內沒有已合併 PR
描述
**Atom**: 1.33.0 x64
**Electron**: 2.0.11
**OS**: Mac OS X 10.14.2
**Thrown From**: [pigments](https://github.com/abe33/atom-pigments) package 0.40.2
### Stack Trace
Uncaught TypeError: Cannot destructure property `textNodes` of 'undefined' or 'null'.
```
At /Applications/Atom.app/Contents/Resources/app/static/:11
TypeError: Cannot destructure property `textNodes` of 'undefined' or 'null'.
at TextEditorComponent.screenPositionForPixelPosition (/Applications/Atom.app/Contents/Resources/app/static/:11:107558)
at HTMLElement.screenPositionForPixelPosition (/app.asar/src/text-editor-element.js:250:32)
at HTMLElement.ColorBufferElement.screenPositionForMouseEvent (/packages/pigments/lib/color-buffer-element.coffee:429:22)
at HTMLElement.ColorBufferElement.colorMarkerForMouseEvent (/packages/pigments/lib/color-buffer-element.coffee:415:17)
at Object.colorMarkerForMouseEvent (/packages/pigments/lib/pigments.coffee:221:25)
at Object.shouldDisplayContextMenu (/packages/pigments/lib/pigments.coffee:215:5)
at /packages/pigments/lib/pigments.coffee:111:36)
at ContextMenuManager.t.exports.ContextMenuManager.cloneItemForEvent (/Applications/Atom.app/Contents/Resources/app/static/:11:400400)
at ContextMenuManager.t.exports.ContextMenuManager.templateForEvent (/Applications/Atom.app/Contents/Resources/app/static/:11:399280)
at ContextMenuManager.t.exports.ContextMenuManager.showForEvent (/Applications/Atom.app/Contents/Resources/app/static/:11:400723)
at WindowEventHandler.handleDocumentContextmenu (/Applications/Atom.app/Contents/Resources/app/static/:11:287614)
```
### Commands
```
3x -2:13.2.0 core:backspace (input.hidden-input)
-2:10.8.0 core:save (input.hidden-input)
-2:10 core:copy (input.hidden-input)
-2:09.1.0 core:paste (input.hidden-input)
-2:08.8.0 core:save (input.hidden-input)
3x -2:06.5.0 core:backspace (input.hidden-input)
2x -2:05.5.0 core:save (input.hidden-input)
2x -1:39.4.0 core:backspace (input.hidden-input)
-1:36.1.0 core:save (input.hidden-input)
-0:32.7.0 core:copy (input.hidden-input)
2x -0:32 editor:newline (input.hidden-input)
-0:31.7.0 core:paste (input.hidden-input)
-0:31.4.0 core:backspace (input.hidden-input)
2x -0:31.1.0 core:save (input.hidden-input)
6x -0:14.6.0 core:backspace (input.hidden-input)
-0:09.7.0 core:save (input.hidden-input)
```
### Non-Core Packages
```
atom-abbreviation 2.5.0
atom-beautify 0.33.4
atom-clock 0.1.16
atom-handlebars 1.3.0
atom-ide-ui 0.13.0
atom-typescript 12.7.3
auto-detect-indentation 1.3.0
busy-signal 1.4.3
emmet 2.4.3
fold-functions 0.11.0
intentions 1.1.5
jshint 1.8.6
language-babel 2.85.0
language-ejs 0.4.0
less-than-slash 0.18.0
lint 0.0.1
linter 2.2.0
linter-csslint 2.0.1
linter-eslint 8.4.1
linter-handlebars 2.5.0
linter-htmlhint 1.5.1
linter-js-standard-jsx 4.1.2
linter-jshint 3.1.9
linter-json-lint 0.1.3
linter-markdown 5.2.2
linter-tslint 1.9.1
linter-ui-default 1.7.1
node-debugger 1.10.1
open-recent 5.0.0
pigments 0.40.2
teletype 0.13.3
toggler 0.3.1
zentabs 0.8.9
```
貢獻指南
研究方向
錯誤源自 color-buffer-element.coffee 第 429 行,該處呼叫了 screenPositionForMouseEvent。堆疊追蹤顯示 Atom 核心中發生了解構失敗,可能是因為 TextEditorComponent 未定義。先檢查 color-buffer-element.coffee 檔案,以了解 screenPositionForMouseEvent 的實作方式,以及它所預期的 context。檢查滑鼠事件發生時 editor component 是否已正確初始化。在 Atom 的 dev mode 中執行 package 並重現錯誤,有助於找出缺少的 property。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- coffeescript, javascript
- 領域
- desktop, tooling
- Issue 類型
- 缺陷
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100