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: body.filter is not a function #1052

Closed
ghost opened this Issue Mar 18, 2018 · 30 comments

Comments

Projects
None yet
@ghost

ghost commented Mar 18, 2018

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.25.0 x64
Electron: 1.7.11
OS: Unknown Windows version
Thrown From: settings-view package 0.254.1

Stack Trace

Uncaught TypeError: body.filter is not a function

At D:\ProgramDevTools\Atom x64\resources\app\node_modules\settings-view\lib\atom-io-client.js:305

TypeError: body.filter is not a function
    at Request._callback (D:/ProgramDevTools/Atom x64/resources/app/node_modules/settings-view/lib/atom-io-client.js:305:39)
    at Request.self.callback (/app.asar/node_modules/settings-view/node_modules/request/request.js:186:22)
    at emitTwo (events.js:106:13)
    at Request.emit (events.js:194:7)
    at /app.asar/node_modules/settings-view/node_modules/request/request.js:1163:10)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:191:7)
    at /app.asar/node_modules/settings-view/node_modules/request/request.js:1085:12)
    at Object.onceWrapper (events.js:293:19)
    at emitNone (events.js:91:20)
    at Gunzip.emit (events.js:188:7)
    at endReadableNT (_stream_readable.js:975:12)
    at _combinedTickCallback (internal/process/next_tick.js:80:11)
    at process._tickCallback (internal/process/next_tick.js:104:9)

Commands

  2x -4:37.1.0 core:paste (span.syntax--text.syntax--plain.syntax--null-grammar)
     -1:54.7.0 core:backspace (input.hidden-input)
     -0:43.9.0 command-palette:toggle (atom-workspace.workspace.scrollbars-visible-always.theme-one-dark-syntax.theme-one-dark-ui)
     -0:25.1.0 github:toggle-git-tab (atom-workspace.workspace.scrollbars-visible-always.theme-one-dark-syntax.theme-one-dark-ui)
     -0:13.1.0 github:toggle-github-tab (div.github-Panel.is-empty)

Non-Core Packages

linter-gcc 0.7.1 
@rsese

This comment has been minimized.

Member

rsese commented Mar 19, 2018

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)?
@Saidbek

This comment has been minimized.

Saidbek commented Apr 24, 2018

any progress here? having the same error while trying to install a package Atom 1.26.0, Mac OS HS

@paladinic

This comment has been minimized.

paladinic commented Apr 24, 2018

Same here. Happened after:

  1. Setting to default
  2. Installing "color-picker"
  3. Installing "webbox-color"
  4. Uninstall "webbox-color" (because deprecated)
  5. Now receiving "TypeError" when searching anything in "Install"
@quancore

This comment has been minimized.

quancore commented Apr 24, 2018

Same here for installing packages

@svalgaard

This comment has been minimized.

svalgaard commented Apr 24, 2018

Hi
I have the same error on my Mac

[Enter steps to reproduce:]

  1. Go to "install packages"
  2. Search for any package
  3. The error message appars

The error also appears after a restart.
Using /Applications/Atom.app/Contents/MacOS/Atom --safe does not help

Atom: 1.26.0 x64
Electron: 1.7.11
OS: Mac OS X 10.13.4
Thrown From: settings-view package 0.254.2

Stack Trace

Uncaught TypeError: body.filter is not a function

At /Applications/Atom.app/Contents/Resources/app/node_modules/settings-view/lib/atom-io-client.js:305

TypeError: body.filter is not a function
    at Request._callback (/Applications/Atom.app/Contents/Resources/app/node_modules/settings-view/lib/atom-io-client.js:305:39)
    at Request.self.callback (/app.asar/node_modules/settings-view/node_modules/request/request.js:186:22)
    at emitTwo (events.js:106:13)
    at Request.emit (events.js:194:7)
    at /app.asar/node_modules/settings-view/node_modules/request/request.js:1163:10)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:191:7)
    at /app.asar/node_modules/settings-view/node_modules/request/request.js:1085:12)
    at Object.onceWrapper (events.js:293:19)
    at emitNone (events.js:91:20)
    at Gunzip.emit (events.js:188:7)
    at endReadableNT (_stream_readable.js:975:12)
    at _combinedTickCallback (internal/process/next_tick.js:80:11)
    at process._tickCallback (internal/process/next_tick.js:104:9)

Commands

  3x -1:38.3.0 core:backspace (input.hidden-input)
  2x -1:36.1.0 core:confirm (input.hidden-input)

Non-Core Packages


@jjmax75

This comment has been minimized.

jjmax75 commented Apr 24, 2018

Happens when I try searching for a package to install

/Applications/Atom.app/Contents/Resources/app/node_modules/settings-view/lib/atom-io-client.js:305
Hide Stack Trace
TypeError: body.filter is not a function
    at Request._callback (/Applications/Atom.app/Contents/Resources/app/node_modules/settings-view/lib/atom-io-client.js:305:39)
    at Request.self.callback (/Users/john/.atom/packages/atom-beautify/node_modules/request/request.js:186:22)
    at emitTwo (events.js:106:13)
    at Request.emit (events.js:194:7)
    at Request.<anonymous> (/Users/john/.atom/packages/atom-beautify/node_modules/request/request.js:1163:10)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:191:7)
    at Gunzip.<anonymous> (/Users/john/.atom/packages/atom-beautify/node_modules/request/request.js:1085:12)
    at Object.onceWrapper (events.js:293:19)
    at emitNone (events.js:91:20)
    at Gunzip.emit (events.js:188:7)
    at endReadableNT (_stream_readable.js:975:12)
    at _combinedTickCallback (internal/process/next_tick.js:80:11)
    at process._tickCallback (internal/process/next_tick.js:104:9)

and

The error was thrown from the atom-beautify package. You can help by creating an issue. Please explain what actions triggered this error.
@Kimer0

This comment has been minimized.

Kimer0 commented Apr 24, 2018

Today same problem here :(

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.26.0 x64
Electron: 1.7.11
OS: Mac OS X 10.11.6
Thrown From: settings-view package 0.254.2

Stack Trace

Uncaught TypeError: body.filter is not a function

At /Applications/Atom.app/Contents/Resources/app/node_modules/settings-view/lib/atom-io-client.js:305

TypeError: body.filter is not a function
    at Request._callback (/Applications/Atom.app/Contents/Resources/app/node_modules/settings-view/lib/atom-io-client.js:305:39)
    at Request.self.callback (/app.asar/node_modules/settings-view/node_modules/request/request.js:186:22)
    at emitTwo (events.js:106:13)
    at Request.emit (events.js:194:7)
    at /app.asar/node_modules/settings-view/node_modules/request/request.js:1163:10)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:191:7)
    at /app.asar/node_modules/settings-view/node_modules/request/request.js:1085:12)
    at Object.onceWrapper (events.js:293:19)
    at emitNone (events.js:91:20)
    at Gunzip.emit (events.js:188:7)
    at endReadableNT (_stream_readable.js:975:12)
    at _combinedTickCallback (internal/process/next_tick.js:80:11)
    at process._tickCallback (internal/process/next_tick.js:104:9)

Commands

     -0:27.5.0 core:paste (input.hidden-input)
     -0:26.6.0 core:undo (input.hidden-input)

Non-Core Packages

atom-beautify 0.32.2 
emmet 2.4.3 
file-icons 2.1.18 
minimap 4.29.8 
pigments 0.40.2 
@huangzheng2016

This comment has been minimized.

huangzheng2016 commented Apr 24, 2018

Error
[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.26.0 x64
Electron: 1.7.11
OS: Unknown Windows version
Thrown From: settings-view package 0.254.2

Stack Trace

Uncaught TypeError: body.filter is not a function

At C:\Users\hz2016\AppData\Local\atom\app-1.26.0\resources\app\node_modules\settings-view\lib\atom-io-client.js:305

TypeError: body.filter is not a function
    at Request._callback (~/AppData/Local/atom/app-1.26.0/resources/app/node_modules/settings-view/lib/atom-io-client.js:305:39)
    at Request.self.callback (/app.asar/node_modules/settings-view/node_modules/request/request.js:186:22)
    at emitTwo (events.js:106:13)
    at Request.emit (events.js:194:7)
    at /app.asar/node_modules/settings-view/node_modules/request/request.js:1163:10)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:191:7)
    at /app.asar/node_modules/settings-view/node_modules/request/request.js:1085:12)
    at Object.onceWrapper (events.js:293:19)
    at emitNone (events.js:91:20)
    at IncomingMessage.emit (events.js:188:7)
    at endReadableNT (_stream_readable.js:975:12)
    at _combinedTickCallback (internal/process/next_tick.js:80:11)
    at process._tickCallback (internal/process/next_tick.js:104:9)

Commands

  7x -1:39.3.0 core:backspace (input.hidden-input)
     -0:53.9.0 core:paste (input.hidden-input)
     -0:53.4.0 core:select-all (input.hidden-input)
     -0:51.6.0 core:confirm (input.hidden-input)

Non-Core Packages

gpp-compiler 3.0.7 
intentions 1.1.5 
linter 2.2.0 
linter-gcc 0.7.1 
linter-ui-default 1.7.1 
platformio-ide-terminal 2.8.1 
simplified-chinese-menu 5.3.5 
tokamak-terminal 10.0.1 
@angristan

This comment has been minimized.

angristan commented Apr 24, 2018

Just happened to me to 1.26.0, W10, 64 bits. Disabling the extensions I just installed did not fix the issue, nor did restarting Atom

@igotinfected

This comment has been minimized.

igotinfected commented Apr 24, 2018

Same issue, I have a .md with markdown-preview-plus running.
Steps:

  • load atom, load .md file, load markdown preview
  • 'cmd + ,' to settings page
  • click on install or theme
  • enter text to look for package
  • error popup

running on macOS HS
restart did not fix

@bennettdams

This comment has been minimized.

bennettdams commented Apr 24, 2018

Same issue when trying to install new packages (Atom 1.26.0).
Atom Beautify (0.32.2) is installed.
Windows 7 64 bit

@ano95

This comment has been minimized.

ano95 commented Apr 24, 2018

Related, #1058

@angristan

This comment has been minimized.

angristan commented Apr 24, 2018

Fixed for me

@igotinfected

This comment has been minimized.

igotinfected commented Apr 24, 2018

For me too.

@jjmax75

This comment has been minimized.

jjmax75 commented Apr 24, 2018

can confirm is working on my end too, serverside issue with package installs?

@bennettdams

This comment was marked as off-topic.

bennettdams commented Apr 24, 2018

Enabling and disabling autosave fixed it for me.

@rsese

This comment was marked as off-topic.

Member

rsese commented Apr 24, 2018

Thanks for all the details everyone - I've been unable to reproduce with any of the mentioned repro steps mentioned so far. It looks like a handful of folks have gotten past the error by enabling and disabling the autosave package as mentioned in #1058 (comment) (thanks @igotinfected ).

Is anyone else still seeing the error after trying that?

@angristan

This comment was marked as off-topic.

angristan commented Apr 27, 2018

It is not related to autosave.

@svalgaard

This comment has been minimized.

svalgaard commented May 1, 2018

Looking at the stack trace in my earlier comment it very much looks like an interim server error.

I would assume that the issue can be reproduced, if you could "mock" a reply from the relevant sever which does not contain the expected answer?

@aletundo

This comment has been minimized.

aletundo commented Jun 24, 2018

The fault was triggered by a bad response from the search API (eg. a 500 error).

@DSamuylov

This comment has been minimized.

DSamuylov commented Jun 30, 2018

The same issue on Ubuntu 18.04. After installation it works fine, then I try to find sublime theme in installer and get this message. Very said that I have to stop using it....

@jniewt

This comment has been minimized.

jniewt commented Aug 3, 2018

Happens to me with 1.28.1 and 1.29.0. Seems to correlate with package search returning 500 on https://atom.io/packages.

@jaysaurus

This comment has been minimized.

jaysaurus commented Aug 17, 2018

This problem started for me (on .deb install of 1.29.0 on ubuntu 16) after removing either node-debugger/atom-ternjs in quick succession (I forget which order; furthermore, I don't know if it was a coincidence, one of those specific packages or atom itself doing something strange) and then immediately searching install packages thereafter

Solution (?) / Workaround (?)

Ultimately, I found the problem went away performing the following actions. I don't know which action was the "fix", but hopefully this will help someone out:

  1. set local ~/.atom to something like ~/old.atom;
  2. installing atom via the command line as per the documentation here
  3. merge in ~/old.atom via nautilus' folder view (ie. the Gnome Ubuntu standard folder view) into the new ~/.atom that should now have appeared in your home folder but be sure to skip overwrites; use the newly installed modules.
  4. run atom --safe from command line. Immediately close atom command line
  5. run atom.

good luck!

Now, as for cause:

My suspicion is that the install/remove command in atom can sometimes remove dependencies from a node_modules folder that has other dependencies. Given @rsese can't reproduce it, and that it occured while I was adding/removing plugins in quick success, this feels a lot like a race condition (v8 file IO is - in my limited experience - an interesting beasty)...

not knowing exactly where nodeJS' single thread mentality ends and the electron interface with C++/*nix begins that's pure speculation. However, the more I think about it, the more I have this faint recollection of having had a similar problem after removing a bunch of plugins simultanesously a few years ago...

It may be that the file remove/manipulation process is relatively slow; and if the user is too fast, it interrupts whatever execution was still ongoing in the previous instant. Ergo missing dependencies.

@Aerijo

This comment has been minimized.

Aerijo commented Aug 17, 2018

@jaysaurus Was this very recently? The Atom packages website suffered some issue, and was down for a few minutes. It's back up now, so that may have actually solved the issue.

@jaysaurus

This comment has been minimized.

jaysaurus commented Aug 17, 2018

sorry, I posted before I was done. see above :)

@jaysaurus

This comment has been minimized.

jaysaurus commented Aug 17, 2018

ah, ok, maybe it was the package website then! oh well :P

@jaysaurus

This comment has been minimized.

jaysaurus commented Aug 17, 2018

Could we propose, therefore, that atom return a more generic 500 handler when the install packages module has issues talking to the Atom package website? @rsese would you like me to raise that as a new issue?

@rsese

This comment has been minimized.

Member

rsese commented Aug 17, 2018

@jaysaurus - #1065 has been opened to resolve this particular error, do you think that's enough? Though it does seem like in general returning an informative error code/message would be useful in general if that's not the case now.

@jaysaurus

This comment has been minimized.

jaysaurus commented Aug 17, 2018

I think a good clean message like "The atom package repository is temporarily unavailable" would save a lot of headaches because sticklers like me will spend more time than they should looking at error messages and going "Ooooh, I wonder if I can diagnose that" haha!

@h-b

This comment has been minimized.

h-b commented Sep 10, 2018

Same here, happened after searching for "lua". If this means that the package repository is unavailable, why isn't this exception catched to show a message telling the user what's going on? What's the intention of not doing that?

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