abe33 / atom-pigments

An Atom package to display colors in project and files.
MIT License
522 stars 68 forks source link

Uncaught TypeError: Cannot read property 'NaN' of undefined. #354

Open adambois opened 7 years ago

adambois commented 7 years ago

Tried to edit a stylsheet and got Uncaught TypeError: Cannot read property 'NaN' of undefined. Seems to be ever since I upgraded my OS to High Seirra version 10.13. Pigments now causes the stylesheets to be unresponsive.

Atom: 1.20.1 x64 Electron: 1.6.9 OS: Mac OS X 10.13 Thrown From: pigments package 0.40.2

Stack Trace

Uncaught TypeError: Cannot read property 'NaN' of undefined

At /Applications/Atom.app/Contents/Resources/app/src/text-editor-component.js:958

TypeError: Cannot read property 'NaN' of undefined
    at TextEditorComponent.renderedScreenLineForRow (/Applications/Atom.app/Contents/Resources/app/src/text-editor-component.js:958:37)
    at TextEditorComponent.pixelLeftForRowAndColumn (/Applications/Atom.app/Contents/Resources/app/src/text-editor-component.js:2364:35)
    at TextEditorComponent.pixelPositionForScreenPosition (/Applications/Atom.app/Contents/Resources/app/src/text-editor-component.js:204:46)
    at HTMLElement.pixelPositionForScreenPosition (/Applications/Atom.app/Contents/Resources/app/src/text-editor-element.js:243:32)
    at /packages/pigments/lib/color-buffer-element.coffee:327:36)
    at HTMLElement.ColorBufferElement.updateDotDecorationsOffsets (/packages/pigments/lib/color-buffer-element.coffee:319:7)
    at /packages/pigments/lib/color-buffer-element.coffee:250:14
    at Array.forEach (native)
    at /packages/pigments/lib/color-buffer-element.coffee:249:20
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:25:20)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:141:34)
    at /Applications/Atom.app/Contents/Resources/app/src/text-editor.js:626:38
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:25:20)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:141:34)
    at DisplayLayer.emitDidChangeSyncEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/display-layer.js:823:24)
    at /Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:757:35
    at Map.forEach (native)
    at TextBuffer.module.exports.TextBuffer.emitDidChangeEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:756:47)
    at TextBuffer.module.exports.TextBuffer.applyChange (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:739:18)
    at TextBuffer.module.exports.TextBuffer.revertToCheckpoint (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:946:22)
    at TextBuffer.module.exports.TextBuffer.transact (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:897:20)
    at TextEditor.module.exports.TextEditor.transact (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:1673:32)
    at /Applications/Atom.app/Contents/Resources/app/src/text-editor.js:1234:30
    at TextEditor.module.exports.TextEditor.mergeSelections (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:2617:49)
    at TextEditor.module.exports.TextEditor.mergeIntersectingSelections (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:2583:41)
    at TextEditor.module.exports.TextEditor.mutateSelectedText (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:1232:25)
    at TextEditor.module.exports.TextEditor.insertText (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:1198:25)
    at TextEditor.object.(anonymous function) [as insertText] (/Applications/Atom.app/Contents/Resources/app/node_modules/underscore-plus/lib/underscore-plus.js:77:33)
    at TextEditorComponent.didTextInput (/Applications/Atom.app/Contents/Resources/app/src/text-editor-component.js:1651:28)

Commands

Non-Core Packages

atom-beautify 0.30.5 
atom-bootstrap4 1.4.0 
atom-css-comb 3.3.1 
atom-material-syntax-dark 1.0.0 
atom-material-ui 2.0.4 
autoprefixer 3.7.1 
busy 0.7.0 
emmet 2.4.3 
file-icons 2.1.12 
language-gitignore 0.3.0 
minimap 4.29.7 
php-cs-fixer 4.1.1 
pigments 0.40.2 
tree-view-git-status 1.4.0 
w3c-validation 0.4.0 
senki commented 7 years ago

It's probably not tied to High Sierra. I'm experiencing the same issue with Atom 1.21.0 and pigments 0.40.2 on Sierra (10.12.6)

adambois commented 7 years ago

Mine actually worked with that version of Sierra (10.12.6) but as soon as I upgraded to High Sierra the issue first occurred. Have you had any luck your end with a solution?

cjrutherford commented 7 years ago

Having the same issue on windows.

Not even editing a CSS file for Atom, but one for my project.

Disabling Pigments for now

p0lm commented 6 years ago

Linux (Manjaro XFCE) too.

BLovegrove commented 6 years ago

I literally just tried to right-click on a text document (win10, with multiple community packages installed) and pigments throws this error? Strange...

Stack trace:

TypeError: Cannot read property 'NaN' of undefined
    at TextEditorComponent.renderedScreenLineForRow (C:\Users\OEM\AppData\Local\atom\app-1.23.0\resources\app\src\text-editor-component.js:959:37)
    at TextEditorComponent.screenPositionForPixelPosition (C:\Users\OEM\AppData\Local\atom\app-1.23.0\resources\app\src\text-editor-component.js:2398:33)
    at HTMLElement.screenPositionForPixelPosition (C:\Users\OEM\AppData\Local\atom\app-1.20.1\resources\app\src\text-editor-element.js:247:32)
    at HTMLElement.ColorBufferElement.screenPositionForMouseEvent (file:///C:/Users/OEM/.atom/packages/pigments/lib/color-buffer-element.coffee:429:22)
    at HTMLElement.ColorBufferElement.colorMarkerForMouseEvent (file:///C:/Users/OEM/.atom/packages/pigments/lib/color-buffer-element.coffee:415:17)
    at Object.colorMarkerForMouseEvent (file:///C:/Users/OEM/.atom/packages/pigments/lib/pigments.coffee:221:25)
    at Object.shouldDisplayContextMenu (file:///C:/Users/OEM/.atom/packages/pigments/lib/pigments.coffee:215:5)
    at Object.atom.contextMenu.add.atom-text-editor.shouldDisplay (file:///C:/Users/OEM/.atom/packages/pigments/lib/pigments.coffee:111:36)
    at ContextMenuManager.module.exports.ContextMenuManager.cloneItemForEvent (C:\Users\OEM\AppData\Local\atom\app-1.23.0\resources\app\src\context-menu-manager.js:167:25)
    at ContextMenuManager.module.exports.ContextMenuManager.templateForEvent (C:\Users\OEM\AppData\Local\atom\app-1.23.0\resources\app\src\context-menu-manager.js:100:39)
    at ContextMenuManager.module.exports.ContextMenuManager.showForEvent (C:\Users\OEM\AppData\Local\atom\app-1.23.0\resources\app\src\context-menu-manager.js:189:33)
    at WindowEventHandler.handleDocumentContextmenu (C:\Users\OEM\AppData\Local\atom\app-1.23.0\resources\app\src\window-event-handler.js:251:44)
delta-one commented 6 years ago

I'm getting the same error. I just tried to right in a simple text document. Using Atom 1.23.1 on Debian 64 bit.

TypeError: Cannot read property 'NaN' of undefined
    at TextEditorComponent.renderedScreenLineForRow (/usr/share/atom/resources/app/src/text-editor-component.js:959:37)
    at TextEditorComponent.screenPositionForPixelPosition (/usr/share/atom/resources/app/src/text-editor-component.js:2398:33)
    at HTMLElement.screenPositionForPixelPosition (/usr/share/atom/resources/app/src/text-editor-element.js:247:32)
    at HTMLElement.ColorBufferElement.screenPositionForMouseEvent (/home/zero/.atom/packages/pigments/lib/color-buffer-element.coffee:429:22)
    at HTMLElement.ColorBufferElement.colorMarkerForMouseEvent (/home/zero/.atom/packages/pigments/lib/color-buffer-element.coffee:415:17)
    at Object.colorMarkerForMouseEvent (/home/zero/.atom/packages/pigments/lib/pigments.coffee:221:25)
    at Object.shouldDisplayContextMenu (/home/zero/.atom/packages/pigments/lib/pigments.coffee:215:5)
    at Object.atom.contextMenu.add.atom-text-editor.shouldDisplay (/home/zero/.atom/packages/pigments/lib/pigments.coffee:111:36)
    at ContextMenuManager.module.exports.ContextMenuManager.cloneItemForEvent (/usr/share/atom/resources/app/src/context-menu-manager.js:167:25)
    at ContextMenuManager.module.exports.ContextMenuManager.templateForEvent (/usr/share/atom/resources/app/src/context-menu-manager.js:100:39)
    at ContextMenuManager.module.exports.ContextMenuManager.showForEvent (/usr/share/atom/resources/app/src/context-menu-manager.js:189:33)
    at WindowEventHandler.handleDocumentContextmenu (/usr/share/atom/resources/app/src/window-event-handler.js:251:44)`
ttasovac commented 6 years ago

Same here. 1.23.1 on High Sierra. Happens every time I right click on the a text document. It makes correcting spelling mistakes impossible.

deadda7a commented 6 years ago

I can confirm this Bug, but on Debian Sid.

Atom: 1.23.2 x64 Electron: 1.6.15 OS: Debian GNU/Linux Thrown From: pigments package 0.40.2

Stack Trace

Uncaught TypeError: Cannot read property 'NaN' of undefined

At /usr/share/atom/resources/app/src/text-editor-component.js:959

TypeError: Cannot read property 'NaN' of undefined
    at TextEditorComponent.renderedScreenLineForRow (/usr/share/atom/resources/app/src/text-editor-component.js:959:37)
    at TextEditorComponent.screenPositionForPixelPosition (/usr/share/atom/resources/app/src/text-editor-component.js:2398:33)
    at HTMLElement.screenPositionForPixelPosition (/app.asar/src/text-editor-element.js:247: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.module.exports.ContextMenuManager.cloneItemForEvent (/usr/share/atom/resources/app/src/context-menu-manager.js:167:25)
    at ContextMenuManager.module.exports.ContextMenuManager.templateForEvent (/usr/share/atom/resources/app/src/context-menu-manager.js:100:39)
    at ContextMenuManager.module.exports.ContextMenuManager.showForEvent (/usr/share/atom/resources/app/src/context-menu-manager.js:189:33)
    at WindowEventHandler.handleDocumentContextmenu (/usr/share/atom/resources/app/src/window-event-handler.js:251:44)

Commands

     -3:55 application:open-folder (input.hidden-input)
     -3:26.3.0 application:reopen-project (input.hidden-input)
     -2:16.9.0 intentions:highlight (input.hidden-input)
     -2:16.9.0 core:select-all (input.hidden-input)
     -2:16.6.0 core:paste (input.hidden-input)
     -2:15.7.0 intentions:highlight (input.hidden-input)
     -2:15.5.0 core:save (input.hidden-input)
  2x -1:49.4.0 core:backspace (input.hidden-input)
     -1:46.7.0 intentions:highlight (input.hidden-input)
     -1:46.4.0 core:save (input.hidden-input)
     -1:43.9.0 intentions:highlight (input.hidden-input)
     -1:43.6.0 core:save (input.hidden-input)

Non-Core Packages

atom-beautify 0.30.9 
atom-latex 0.8.2 
autocomplete-bibtex 1.1.0 
autocomplete-clang 0.11.4 
autocomplete-php 0.3.7 
code-stats-atom 2.0.6 
file-icons 2.1.15 
file-types 0.5.5 
highlight-selected 0.13.1 
intentions 1.1.5 
language-ini 1.19.0 
language-patch 1.2.0 
language-spec 0.1.0 
linter 2.2.0 
linter-gcc 0.7.1 
linter-js-standard 4.2.0 
linter-phpmd 2.0.0 
linter-ui-default 1.6.10 
minimap 4.29.7 
minimap-highlight-selected 4.6.1 
piatto-light-syntax 0.2.2 
pigments 0.40.2 
two-light-ui 1.1.3