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 'remove' of undefined #1997

Closed
SpaceLens opened this issue Nov 15, 2019 · 38 comments
Closed

Uncaught TypeError: Cannot read property 'remove' of undefined #1997

SpaceLens opened this issue Nov 15, 2019 · 38 comments

Comments

@SpaceLens
Copy link

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.40.1 x64
Electron: 3.1.10
OS: Ubuntu 18.04.3
Thrown From: script package 3.25.0

Stack Trace

Uncaught TypeError: Cannot read property 'remove' of undefined

At /home/paul/.atom/packages/script/node_modules/atom-message-panel/lib/MessagePanelView.js:189

TypeError: Cannot read property 'remove' of undefined
    at ScriptView.MessagePanelView.remove (/packages/script/node_modules/atom-message-panel/lib/MessagePanelView.js:189:30)
    at ScriptView.detach (/packages/open-in-browsers/node_modules/jquery/dist/jquery.js:5357:15)
    at ScriptView.removePanel (/packages/script/lib/script-view.js:89:10)
    at Object.closeScriptViewAndStopRunner (/packages/script/lib/script.js:161:21)
    at HTMLElement.scriptCloseView (/packages/script/lib/script.js:94:39)
    at CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app/static/<embedded>:11:349123)
    at CommandRegistry.dispatch (/usr/share/atom/resources/app/static/<embedded>:11:347598)
    at ScriptView.close (/packages/script/lib/script-view.js:99:19)
    at /packages/open-in-browsers/node_modules/space-pen/lib/space-pen.js:220:36)
    at HTMLDivElement.dispatch (/packages/open-in-browsers/node_modules/jquery/dist/jquery.js:4435:9)
    at HTMLDivElement.elemData.handle (/packages/open-in-browsers/node_modules/jquery/dist/jquery.js:4121:28)

Commands

  4x -0:24.8.0 core:save (input.hidden-input)
     -0:22.7.0 core:close (input.hidden-input)
     -0:22 editor:consolidate-selections (input.hidden-input)
     -0:22 core:cancel (input.hidden-input)
     -0:21.4.0 editor:consolidate-selections (input.hidden-input)
     -0:21.4.0 core:cancel (input.hidden-input)
     -0:21.2.0 editor:consolidate-selections (input.hidden-input)
     -0:21.2.0 core:cancel (input.hidden-input)
     -0:21.1.0 editor:consolidate-selections (input.hidden-input)
     -0:21.1.0 core:cancel (input.hidden-input)
     -0:20.9.0 editor:consolidate-selections (input.hidden-input)
     -0:20.9.0 core:cancel (input.hidden-input)
     -0:20.7.0 editor:consolidate-selections (input.hidden-input)
     -0:20.7.0 core:cancel (input.hidden-input)
     -0:14.3.0 core:close (atom-pane.pane.active)
     -0:05.7.0 script:close-view (atom-workspace.workspace.scrollbars-visible-always.theme-one-dark-syntax.theme-one-dark-ui)

Non-Core Packages

emmet 2.4.3 
open-in-browsers 0.0.30 
script 3.25.0 
@vsharm29
Copy link

when ever I try to run my code by pressing keys ctrl + shift + B. The down pane opens up and shows output of the code. When ever I try to close the pane it raises an error. Please look into this issue, it's very irritating.

@Pixel48
Copy link

Pixel48 commented Nov 15, 2019

Im trying to fix this, but for know fou can use ctrl-shift-f5. And i know, it's not solution

when ever I try to run my code by pressing keys ctrl + shift + B. The down pane opens up and shows output of the code. When ever I try to close the pane it raises an error. Please look into this issue, it's very irritating.

@JordanTheDodger
Copy link

I am getting the same error. It was fine until yesterday. I think there is something wrong with the library that deals with MessagePanelView

@shreyasgaonkar
Copy link

shreyasgaonkar commented Nov 18, 2019

This shows up on other keyboard shortcuts not dealing with the module as well. Not able to close active tabs using cmd + w is really annoying

MacOS: Mojave 10.14.6 (18G103)
Atom: 1.40.1 x64

@Talon24
Copy link

Talon24 commented Nov 18, 2019

When the output pane is stuck already, i also get an error thrown when I press ESC

@VinnieM
Copy link

VinnieM commented Nov 19, 2019

This same issue is happening in Mac OS as well.
Atom: 1.41.0
OS : Catalina 10.15.1.

@xumang
Copy link

xumang commented Nov 19, 2019

The same error occurs when I try to kill this process.
Atom 1.41.0 x64,win10

@mkrd
Copy link

mkrd commented Nov 20, 2019

Same issue here

This same issue is happening in Mac OS as well.
Atom: 1.41.0
OS : Catalina 10.15.1.

@creativecag
Copy link

+1

@tswinb
Copy link

tswinb commented Nov 21, 2019

Same issue here. Windows 10, Atom 1.41.0 x64

@Callum-25252
Copy link

Callum-25252 commented Nov 21, 2019

I have the same issue, also occurs when I press ESC or use CTRL+W. Ubuntu 18.04, Atom 1.40.0

@fdq09eca
Copy link

same with @AStartledRaccoon

@medardm
Copy link

medardm commented Nov 23, 2019

Still no solution to this issue? :(

@medardm
Copy link

medardm commented Nov 25, 2019

Here's a temporary solution. Modify function in line 187 under
.atom\packages\script\node_modules\atom-message-panel\lib\MessagePanelView.js
from

MessagePanelView.prototype.remove = function (index) {
  this.messages.splice(-index, 1);
  this.body.children()[index].remove();
};

to:

MessagePanelView.prototype.remove = function (index) {
  $('.native-key-bindings.script-view').remove();
};

@Callum-25252
Copy link

@medardm 's solution worked for me!

@medardm
Copy link

medardm commented Nov 25, 2019

@AStartledRaccoon I'm glad it worked. :)

@raffaeleGrandi
Copy link

It works also for me thanks

@Brolly0204
Copy link

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.41.0 x64
Electron: 4.2.7
OS: Mac OS X 10.15
Thrown From: script package 3.25.0

Stack Trace

Uncaught TypeError: Cannot read property 'remove' of undefined

At /Users/jasonli/.atom/packages/script/node_modules/atom-message-panel/lib/MessagePanelView.js:188

@Sirfanas
Copy link

Sirfanas commented Dec 2, 2019

Thank's @medardm for the fix !
Maybe you could made a pull request to include it ?

@medardm
Copy link

medardm commented Dec 3, 2019

I will when I find a long term solution. Because the solution I introduced was an adjustment with one of the dependencies, not with the actual package.

@kimathie
Copy link

kimathie commented Dec 4, 2019

When I press escape and or try to close the output panel I get this error.

@rifusaki
Copy link

rifusaki commented Dec 6, 2019

@medardm Could you tell us which dependecy you used? So we can use your fix. Thanks!

@VinnieM
Copy link

VinnieM commented Dec 6, 2019

@medardm Thanks for the fix!!!

@kimathie
Copy link

kimathie commented Dec 6, 2019

@medardm thanks I hadn't seen that solution. It works

@ghost
Copy link

ghost commented Dec 7, 2019

same issue here, please fix it!
Windows 10 | Atom 1.41.0 x64

@medardm
Copy link

medardm commented Dec 9, 2019

@CharaDraemurr I didn't change any of the dependencies, just modified a line of code on one of the dependencies of this package, but this is not a long term solution.

Here's a temporary solution. Modify function in line 187 under
.atom\packages\script\node_modules\atom-message-panel\lib\MessagePanelView.js
from

MessagePanelView.prototype.remove = function (index) {
  this.messages.splice(-index, 1);
  this.body.children()[index].remove();
};

to:

MessagePanelView.prototype.remove = function (index) {
  $('.native-key-bindings.script-view').remove();
};

@ghost
Copy link

ghost commented Dec 10, 2019

Just downloaded this package and found this bug, please fix it!

@medardm
Copy link

medardm commented Dec 11, 2019

@Fellox . There's already a PR to fix this issue (#2004). You can review it on your side. I already checked it and it works

@DeathGOD7
Copy link

Here's a temporary solution. Modify function in line 187 under
.atom\packages\script\node_modules\atom-message-panel\lib\MessagePanelView.js
from

MessagePanelView.prototype.remove = function (index) {
  this.messages.splice(-index, 1);
  this.body.children()[index].remove();
};

to:

MessagePanelView.prototype.remove = function (index) {
  $('.native-key-bindings.script-view').remove();
};

That is the solution for now. Thanks for it. :)

@hex0x42424242
Copy link

nice bro, works for me.
Thanks!

@jakelevifulfil
Copy link

This hasn't worked for me :(

Also, editing the files seems to have no effect, even if I intentionally add syntax errors or just comment out the code. I'm looking in <Username>\.atom\packages\script\node_modules\atom-message-panel\lib.

@creativecag
Copy link

This hasn't worked for me :(

Also, editing the files seems to have no effect, even if I intentionally add syntax errors or just comment out the code. I'm looking in <Username>\.atom\packages\script\node_modules\atom-message-panel\lib.

I had a similar problem. Gave up on it for now.

@junepark6
Copy link

I also still have this issue. Panel could be removed after modifying the source as you suggested, but it was only working one time. I mean, if I removed the panel before and run again the script, then I cannot remove the panel.

@wesgt
Copy link

wesgt commented Feb 11, 2020

@junepark6 I had a similar problem. But follow below to make changes and it worked for me.

go to .atom\packages\script\node_modules\atom-message-panel\lib\MessagePanelView.js

MessagePanelView.prototype.remove = function (index) {
  this.messages.splice(-index, 1);
  this.body.children().remove(index);
};

@creativecag
Copy link

@wesgt That appears to have worked for me as well. Thanks!

@jakelevifulfil
Copy link

It fixed itself for me... Didn't make any changes, but all's good now! :)

@mavericks52
Copy link

@wesgt I now have a problem after your fix where i cant run the program after i close the script window

@lazerbolt390
Copy link

@wesgt thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests