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 'add' of null - find-and-replace #16133

Closed
alexdevero opened this Issue Nov 8, 2017 · 22 comments

Comments

Projects
None yet
8 participants
@alexdevero

alexdevero commented Nov 8, 2017

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.23.0-beta0 x64
Electron: 1.6.15
OS: Microsoft Windows 10 Home
Thrown From: Atom Core

Stack Trace

Uncaught TypeError: Cannot read property 'add' of null

At C:\Users\Alex\AppData\Local\atom\app-1.23.0-beta0\resources\app\node_modules\find-and-replace\lib\get-icon-services.js:63

TypeError: Cannot read property 'add' of null
    at get_process.nextTick (~/AppData/Local/atom/app-1.23.0-beta0/resources/app/node_modules/find-and-replace/lib/get-icon-services.js:63:34)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)

Commands

     -6:14.3.0 project-find:show (atom-pane.pane)
     -6:13.5.0 core:paste (input.hidden-input)
     -6:13 core:confirm (input.hidden-input)
     -5:48.9.0 core:close (div.results-view.focusable-panel)
     -0:40.8.0 project-find:show (atom-workspace.workspace.scrollbars-visible-always.theme-atom-material-syntax-dark.theme-atom-material-ui)
     -0:30.3.0 core:confirm (input.hidden-input)

Non-Core Packages

atom-css-comb 3.3.1 
atom-handlebars 1.3.0 
atom-material-syntax 1.0.7 
atom-material-syntax-dark 1.0.0 
atom-material-ui 2.0.6 
auto-detect-indentation 1.3.0 
busy-signal 1.4.3 
counter 0.3.5 
css-snippets 1.1.0 
editorconfig 2.2.2 
emmet 2.4.3 
file-icons 2.1.13 
file-types 0.5.5 
hidpi 0.14.0 
highlight-line 0.12.0 
highlight-selected 0.13.1 
intentions 1.1.5 
language-babel 2.78.0 
language-dots 0.0.4 
language-latte 0.4.0 
language-postcss 1.3.1 
less-than-slash 0.17.0 
linter 2.2.0 
linter-js-standard 4.0.2 
linter-ui-default 1.6.10 
menu-editor 0.2.0 
minimap 4.29.7 
minimap-cursorline 0.2.0 
minimap-find-and-replace 4.5.2 
minimap-git-diff 4.3.1 
minimap-highlight-selected 4.6.1 
open-files 0.8.2 
pigments 0.40.2 
react-snippets 1.0.0 
set-syntax 0.4.0 
simple-drag-drop-text 0.3.6 
wordcount 2.10.4 
@rsese

This comment has been minimized.

Show comment
Hide comment
@rsese

rsese Nov 8, 2017

Member

Thanks for the report! Can you confirm a few things for us?

  • what were you doing at the time of the error?
  • is the error is reproducible?
  • if reproducible, do you see the error in safe mode (atom --safe)?

We can move this to https://github.com/atom/find-and-replace/ when we have more details.

Member

rsese commented Nov 8, 2017

Thanks for the report! Can you confirm a few things for us?

  • what were you doing at the time of the error?
  • is the error is reproducible?
  • if reproducible, do you see the error in safe mode (atom --safe)?

We can move this to https://github.com/atom/find-and-replace/ when we have more details.

@Conduitry

This comment has been minimized.

Show comment
Hide comment
@Conduitry

Conduitry Nov 8, 2017

I'm seeing this issue as well. I'm able to consistently reproduce it by scrolling in the 'Project Find Results' tab. I do not see the error with atom --safe.

I too have the file-icons package installed, and disabling that package also stops the exceptions.

Conduitry commented Nov 8, 2017

I'm seeing this issue as well. I'm able to consistently reproduce it by scrolling in the 'Project Find Results' tab. I do not see the error with atom --safe.

I too have the file-icons package installed, and disabling that package also stops the exceptions.

@alexdevero

This comment has been minimized.

Show comment
Hide comment
@alexdevero

alexdevero Nov 9, 2017

@rsese I was using Search & replace - scrolling through 'Project Find Results' tab. It is reproducible as mentioned @Conduitry.

alexdevero commented Nov 9, 2017

@rsese I was using Search & replace - scrolling through 'Project Find Results' tab. It is reproducible as mentioned @Conduitry.

@rsese

This comment has been minimized.

Show comment
Hide comment
@rsese

rsese Nov 10, 2017

Member

Thanks @Conduitry - do you also see the error stop if you disable file-icons @alexdevero? I also have that package installed but can't reproduce.

Member

rsese commented Nov 10, 2017

Thanks @Conduitry - do you also see the error stop if you disable file-icons @alexdevero? I also have that package installed but can't reproduce.

@alexdevero

This comment has been minimized.

Show comment
Hide comment
@alexdevero

alexdevero Nov 10, 2017

I actually can reproduce it after disabling file-icons package:
screen-1
screen-2

alexdevero commented Nov 10, 2017

I actually can reproduce it after disabling file-icons package:
screen-1
screen-2

@alexdevero

This comment has been minimized.

Show comment
Hide comment
@alexdevero

alexdevero Nov 10, 2017

Here is a report from these screens:
[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.23.0-beta0 x64
Electron: 1.6.15
OS: Microsoft Windows 10 Home
Thrown From: file-icons package 2.1.13

Stack Trace

Uncaught TypeError: Cannot read property 'onDidChangeIcon' of undefined

At C:\Users\Alex\.atom\packages\file-icons\lib\service\icon-node.js:30

TypeError: Cannot read property 'onDidChangeIcon' of undefined
    at /packages/file-icons/lib/service/icon-node.js:30:12)
    at Function.forElement (/packages/file-icons/lib/service/icon-node.js:177:17)
    at /packages/file-icons/lib/service/icon-service.js:86:19)
    at get_process.nextTick (~/AppData/Local/atom/app-1.23.0-beta0/resources/app/node_modules/find-and-replace/lib/get-icon-services.js:63:44)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)

Commands

     -2:49.9.0 core:confirm (input.hidden-input)
     -2:44.1.0 project-find:show (button.btn.icon.enablement.icon-playback-play)
     -2:41.6.0 core:confirm (input.hidden-input)
     -2:33 core:close (div.results-view.focusable-panel)
     -2:29.5.0 project-find:show (button.btn.icon.enablement.icon-playback-pause)
     -2:28.9.0 core:confirm (input.hidden-input)
     -1:54.1.0 core:close (a.btn-copy-report.icon.icon-clippy)
     -1:50.9.0 project-find:show (button.btn.icon.enablement.icon-playback-play)
     -1:50 core:confirm (input.hidden-input)
     -1:45 core:close (div.results-view.focusable-panel)
     -1:42.4.0 core:cancel (div.panels-item)
     -1:40 project-find:show (div.panels-item)
     -1:39.1.0 core:confirm (input.hidden-input)
     -0:29.3.0 core:cancel (button.btn.icon.enablement.icon-playback-pause)

Non-Core Packages

atom-css-comb 3.3.1 
atom-handlebars 1.3.0 
atom-material-syntax 1.0.7 
atom-material-syntax-dark 1.0.0 
atom-material-ui 2.0.6 
auto-detect-indentation 1.3.0 
busy-signal 1.4.3 
counter 0.3.5 
css-snippets 1.1.0 
editorconfig 2.2.2 
emmet 2.4.3 
file-icons 2.1.13 
file-types 0.5.5 
hidpi 0.14.0 
highlight-line 0.12.0 
highlight-selected 0.13.1 
intentions 1.1.5 
language-babel 2.78.0 
language-dots 0.0.4 
language-latte 0.4.0 
language-postcss 1.3.1 
less-than-slash 0.17.0 
linter 2.2.0 
linter-js-standard 4.0.2 
linter-ui-default 1.6.10 
menu-editor 0.2.0 
minimap 4.29.7 
minimap-cursorline 0.2.0 
minimap-find-and-replace 4.5.2 
minimap-git-diff 4.3.1 
minimap-highlight-selected 4.6.1 
open-files 0.8.2 
pigments 0.40.2 
react-snippets 1.0.0 
set-syntax 0.4.0 
simple-drag-drop-text 0.3.6 
wordcount 2.10.4 

alexdevero commented Nov 10, 2017

Here is a report from these screens:
[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.23.0-beta0 x64
Electron: 1.6.15
OS: Microsoft Windows 10 Home
Thrown From: file-icons package 2.1.13

Stack Trace

Uncaught TypeError: Cannot read property 'onDidChangeIcon' of undefined

At C:\Users\Alex\.atom\packages\file-icons\lib\service\icon-node.js:30

TypeError: Cannot read property 'onDidChangeIcon' of undefined
    at /packages/file-icons/lib/service/icon-node.js:30:12)
    at Function.forElement (/packages/file-icons/lib/service/icon-node.js:177:17)
    at /packages/file-icons/lib/service/icon-service.js:86:19)
    at get_process.nextTick (~/AppData/Local/atom/app-1.23.0-beta0/resources/app/node_modules/find-and-replace/lib/get-icon-services.js:63:44)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)

Commands

     -2:49.9.0 core:confirm (input.hidden-input)
     -2:44.1.0 project-find:show (button.btn.icon.enablement.icon-playback-play)
     -2:41.6.0 core:confirm (input.hidden-input)
     -2:33 core:close (div.results-view.focusable-panel)
     -2:29.5.0 project-find:show (button.btn.icon.enablement.icon-playback-pause)
     -2:28.9.0 core:confirm (input.hidden-input)
     -1:54.1.0 core:close (a.btn-copy-report.icon.icon-clippy)
     -1:50.9.0 project-find:show (button.btn.icon.enablement.icon-playback-play)
     -1:50 core:confirm (input.hidden-input)
     -1:45 core:close (div.results-view.focusable-panel)
     -1:42.4.0 core:cancel (div.panels-item)
     -1:40 project-find:show (div.panels-item)
     -1:39.1.0 core:confirm (input.hidden-input)
     -0:29.3.0 core:cancel (button.btn.icon.enablement.icon-playback-pause)

Non-Core Packages

atom-css-comb 3.3.1 
atom-handlebars 1.3.0 
atom-material-syntax 1.0.7 
atom-material-syntax-dark 1.0.0 
atom-material-ui 2.0.6 
auto-detect-indentation 1.3.0 
busy-signal 1.4.3 
counter 0.3.5 
css-snippets 1.1.0 
editorconfig 2.2.2 
emmet 2.4.3 
file-icons 2.1.13 
file-types 0.5.5 
hidpi 0.14.0 
highlight-line 0.12.0 
highlight-selected 0.13.1 
intentions 1.1.5 
language-babel 2.78.0 
language-dots 0.0.4 
language-latte 0.4.0 
language-postcss 1.3.1 
less-than-slash 0.17.0 
linter 2.2.0 
linter-js-standard 4.0.2 
linter-ui-default 1.6.10 
menu-editor 0.2.0 
minimap 4.29.7 
minimap-cursorline 0.2.0 
minimap-find-and-replace 4.5.2 
minimap-git-diff 4.3.1 
minimap-highlight-selected 4.6.1 
open-files 0.8.2 
pigments 0.40.2 
react-snippets 1.0.0 
set-syntax 0.4.0 
simple-drag-drop-text 0.3.6 
wordcount 2.10.4 
@alexdevero

This comment has been minimized.

Show comment
Hide comment
@alexdevero

alexdevero Nov 10, 2017

My mistake. After disabling AND restarting Atom I can't reproduce the bug.

alexdevero commented Nov 10, 2017

My mistake. After disabling AND restarting Atom I can't reproduce the bug.

@50Wliu

This comment has been minimized.

Show comment
Hide comment
@50Wliu
Member

50Wliu commented Nov 10, 2017

/cc @Alhadis

@alexdevero

This comment has been minimized.

Show comment
Hide comment
@alexdevero

alexdevero Nov 10, 2017

@50Wliu I had to literally search the meaning of "/cc" .

alexdevero commented Nov 10, 2017

@50Wliu I had to literally search the meaning of "/cc" .

@Alhadis

This comment has been minimized.

Show comment
Hide comment
@Alhadis

Alhadis Nov 10, 2017

Crap, sorry. Let me look into this.

Alhadis commented Nov 10, 2017

Crap, sorry. Let me look into this.

@Alhadis

This comment has been minimized.

Show comment
Hide comment
@Alhadis

Alhadis Nov 10, 2017

@alexdevero What do you see when you open the devtools and run _FileIcons.consumers? The ConsumerManager.consumers array should be empty.

Alhadis commented Nov 10, 2017

@alexdevero What do you see when you open the devtools and run _FileIcons.consumers? The ConsumerManager.consumers array should be empty.

@Alhadis

This comment has been minimized.

Show comment
Hide comment
@Alhadis

Alhadis Nov 10, 2017

Okay, wait. I can reproduce this with a long list of search results...

@nathansobo Does the etch library fire some callback or anything when a VirtualNode is literally attached to the DOM? This is happening because of the process.nextTick hack I used.

It was necessary because the "element" being created by Etch actually doesn't exist at the time the service is consumed, so it needed to fire after the node was visible in the DOM tree.

Alhadis commented Nov 10, 2017

Okay, wait. I can reproduce this with a long list of search results...

@nathansobo Does the etch library fire some callback or anything when a VirtualNode is literally attached to the DOM? This is happening because of the process.nextTick hack I used.

It was necessary because the "element" being created by Etch actually doesn't exist at the time the service is consumed, so it needed to fire after the node was visible in the DOM tree.

@nathansobo

This comment has been minimized.

Show comment
Hide comment
@nathansobo

nathansobo Nov 10, 2017

Contributor

@Alhadis I'm not totally sure what you're after, so this may not be answering your question. You can wait on a promise returned from etch.update after which any updates you've requested will be flushed to the DOM, including the rendering/attachment of child components. That would need to happen in the parent component. I don't think there's anything in a given component to guarantee it's been attached to its parent, like a didAttach hook or something. Child components build their element when they are constructed due to being rendered by the parent component, but there is a gap between constructing them and attaching their elements to the parent. We could potentially add a feature for informing a child component that it is attached to its parent. Ultimately knowing whether a child component is on the document is something that's only available for HTML 5 custom elements, unfortunately. Not sure if that helped.

Contributor

nathansobo commented Nov 10, 2017

@Alhadis I'm not totally sure what you're after, so this may not be answering your question. You can wait on a promise returned from etch.update after which any updates you've requested will be flushed to the DOM, including the rendering/attachment of child components. That would need to happen in the parent component. I don't think there's anything in a given component to guarantee it's been attached to its parent, like a didAttach hook or something. Child components build their element when they are constructed due to being rendered by the parent component, but there is a gap between constructing them and attaching their elements to the parent. We could potentially add a feature for informing a child component that it is attached to its parent. Ultimately knowing whether a child component is on the document is something that's only available for HTML 5 custom elements, unfortunately. Not sure if that helped.

@Alhadis

This comment has been minimized.

Show comment
Hide comment
@Alhadis

Alhadis Nov 10, 2017

@nathansobo I'll take care of this. Gonna send a PR to the find-and-replace package that waits for view.refs.icon to be assigned a DOM reference, using simple polling...

Alhadis commented Nov 10, 2017

@nathansobo I'll take care of this. Gonna send a PR to the find-and-replace package that waits for view.refs.icon to be assigned a DOM reference, using simple polling...

@nathansobo

This comment has been minimized.

Show comment
Hide comment
@nathansobo

nathansobo Nov 10, 2017

Contributor

Awesome. Really appreciate that. I haven't taken the time to fully understand what going on but I think I'll wait to see your PR and that will help me get it more.

Contributor

nathansobo commented Nov 10, 2017

Awesome. Really appreciate that. I haven't taken the time to fully understand what going on but I think I'll wait to see your PR and that will help me get it more.

@Alhadis

This comment has been minimized.

Show comment
Hide comment
@Alhadis

Alhadis Nov 10, 2017

Fix submitted as atom/find-and-replace#971.

@alexdevero You can test this now to see if it works by cloning my fork and linking it locally:

λ git clone git@github.com:Cutlery-Drawer/find-and-replace.git
λ cd find-and-replace
λ git checkout etched-promise
λ apm link -d && apm install .

# Then open whatever project you were experiencing troubles with:
λ cd /whatever/project/you/had/troubles/with
λ atom --dev

Alhadis commented Nov 10, 2017

Fix submitted as atom/find-and-replace#971.

@alexdevero You can test this now to see if it works by cloning my fork and linking it locally:

λ git clone git@github.com:Cutlery-Drawer/find-and-replace.git
λ cd find-and-replace
λ git checkout etched-promise
λ apm link -d && apm install .

# Then open whatever project you were experiencing troubles with:
λ cd /whatever/project/you/had/troubles/with
λ atom --dev
@alexdevero

This comment has been minimized.

Show comment
Hide comment
@alexdevero

alexdevero commented Nov 11, 2017

@Alhadis Thank you!

@burhandodhy

This comment has been minimized.

Show comment
Hide comment
@burhandodhy

burhandodhy Dec 13, 2017

This error start showing after the new update

burhandodhy commented Dec 13, 2017

This error start showing after the new update

@S-anasol

This comment has been minimized.

Show comment
Hide comment
@S-anasol

S-anasol Dec 13, 2017

+1 same error here after update

S-anasol commented Dec 13, 2017

+1 same error here after update

@nathansobo nathansobo reopened this Dec 13, 2017

@nathansobo

This comment has been minimized.

Show comment
Hide comment
@nathansobo

nathansobo Dec 13, 2017

Contributor

This was fixed in find-and-replace@0.215.0, but it didn't make it to 1.23-releases due to a miscommunication. I've upgraded in ef78b68, and we'll get an Atom patch release out with that upgrade soon. Apologies for the trouble.

Contributor

nathansobo commented Dec 13, 2017

This was fixed in find-and-replace@0.215.0, but it didn't make it to 1.23-releases due to a miscommunication. I've upgraded in ef78b68, and we'll get an Atom patch release out with that upgrade soon. Apologies for the trouble.

@50Wliu 50Wliu referenced this issue Dec 13, 2017

Closed

Error when scrolling Project Find Results pane #978

0 of 1 task complete
@nathansobo

This comment has been minimized.

Show comment
Hide comment
@nathansobo

nathansobo Dec 13, 2017

Contributor

This is fixed in 1.23.1. Apologies for the trouble.

Contributor

nathansobo commented Dec 13, 2017

This is fixed in 1.23.1. Apologies for the trouble.

@nathansobo nathansobo closed this Dec 13, 2017

@atom atom deleted a comment from danyboy-pc-pc Jan 2, 2018

@atom atom deleted a comment from danyboy-pc-pc Jan 2, 2018

@lock

This comment has been minimized.

Show comment
Hide comment
@lock

lock bot Jul 1, 2018

This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!

lock bot commented Jul 1, 2018

This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!

@lock lock bot locked as resolved and limited conversation to collaborators Jul 1, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.