Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: Cannot read property 'NaN' of undefined #388

Closed
ghost opened this issue Mar 18, 2018 · 3 comments
Closed

Uncaught TypeError: Cannot read property 'NaN' of undefined #388

ghost opened this issue Mar 18, 2018 · 3 comments

Comments

@ghost
Copy link

ghost commented Mar 18, 2018

[Enter steps to reproduce:]

  1. Open a file in the editor.
  2. Right click anywhere on the text.

Atom: 1.23.3 x64
Electron: 1.6.15
OS: Ubuntu 16.04.4
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

     -8:58 tree-view:remove (span.name.icon.html5-icon.medium-orange)
     -8:26.2.0 find-and-replace:show (div.tool-panel.tree-view)
  9x -8:25.2.0 core:backspace (input.hidden-input)
     -8:22.4.0 editor:consolidate-selections (input.hidden-input)
     -8:22.4.0 core:cancel (input.hidden-input)
  2x -7:58 tree-view:remove (span.name.icon.icon-file-directory)
     -6:28.8.0 core:backspace (input.hidden-input)
     -6:28.2.0 intentions:highlight (input.hidden-input)
     -6:28.1.0 core:save (input.hidden-input)

Non-Core Packages

atom-beautify 0.32.2 
autocomplete-paths 2.12.2 
autoupdate-packages 1.3.1 
busy-signal 1.4.3 
color-picker 2.2.5 
emmet 2.4.3 
file-icons 2.1.17 
git-plus 7.10.2 
git-time-machine 1.5.9 
highlight-selected 0.13.1 
intentions 1.1.5 
language-nginx 0.8.0 
linter 2.2.0 
linter-eslint 8.4.1 
linter-ui-default 1.7.1 
minimap 4.29.8 
monokai 0.24.0 
open-recent 5.0.0 
pigments 0.40.2 
uglify 1.3.1 
@ghost
Copy link
Author

ghost commented Mar 18, 2018

I reinstalled the pigments package and the error went away it seems.

@irunatbullets
Copy link

irunatbullets commented Mar 19, 2018

I tried reinstalling pigments and still have the problem. The Stack Trace is pretty similar apart from slightly different line numbers, perhaps due to my version of atom and OS X vs Ubuntu.

Atom: 1.25.0
OS: macOS High Sierra 10.31.1

TypeError: Cannot read property 'NaN' of undefined
    at TextEditorComponent.renderedScreenLineForRow (/Applications/Atom.app/Contents/Resources/app/src/text-editor-component.js:966:37)
    at TextEditorComponent.screenPositionForPixelPosition (/Applications/Atom.app/Contents/Resources/app/src/text-editor-component.js:2389:33)
    at HTMLElement.screenPositionForPixelPosition (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor-element.js:250:32)
    at HTMLElement.ColorBufferElement.screenPositionForMouseEvent (/Users/murray/.atom/packages/pigments/lib/color-buffer-element.coffee:429:22)
    at HTMLElement.ColorBufferElement.colorMarkerForMouseEvent (/Users/murray/.atom/packages/pigments/lib/color-buffer-element.coffee:415:17)
    at Object.colorMarkerForMouseEvent (/Users/murray/.atom/packages/pigments/lib/pigments.coffee:221:25)
    at Object.shouldDisplayContextMenu (/Users/murray/.atom/packages/pigments/lib/pigments.coffee:215:5)
    at Object.atom.contextMenu.add.atom-text-editor.shouldDisplay (/Users/murray/.atom/packages/pigments/lib/pigments.coffee:111:36)
    at ContextMenuManager.module.exports.ContextMenuManager.cloneItemForEvent (/Applications/Atom.app/Contents/Resources/app/src/context-menu-manager.js:167:25)
    at ContextMenuManager.module.exports.ContextMenuManager.templateForEvent (/Applications/Atom.app/Contents/Resources/app/src/context-menu-manager.js:100:39)
    at ContextMenuManager.module.exports.ContextMenuManager.showForEvent (/Applications/Atom.app/Contents/Resources/app/src/context-menu-manager.js:189:33)
    at WindowEventHandler.handleDocumentContextmenu (/Applications/Atom.app/Contents/Resources/app/src/window-event-handler.js:257:44)

Packages

atom-beautify 0.32.0
atom-ide-ui 0.9.3
atom-silverstripe 3.3.0
busy-signal 1.4.3
css-hyperclick 0.1.5
duplicate-removal 0.1.3
emmet 2.4.3
file-icons 2.1.17
git-blame 1.6.0
git-time-machine 1.5.9
highlight-bad-chars 1.0.7
intentions 1.1.5
js-hyperclick 1.13.0
language-babel 2.84.0
linter-eslint 8.4.1
linter-jshint 3.1.6
linter-scss-lint 3.1.1
minimap 4.29.8
minimap-linter 2.1.3
open-in-browser 0.5.2
pigments 0.40.2
sort-lines 0.18.0
tabs-to-spaces 1.0.3
tag 0.5.0

Workaround (for my specific case) In the settings I changed Supported Filetypes from * to scss, css so it wouldn't try to run inside a SilverStripe template.

@Cxarli
Copy link
Collaborator

Cxarli commented Mar 29, 2018

Duplicate of #377

@Cxarli Cxarli marked this as a duplicate of #377 Mar 29, 2018
@Cxarli Cxarli closed this as completed Mar 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants