Atom gets so slow and shows an error message on console


#1

Atom shows an error message - even if I opened it by safemode.

And it becomes so slow while using 20~30% of CPU capacity on and on even when I haven’t opened any project and doing nothing.

Uncaught (in promise) TypeError: Cannot read property ‘ahead’ of undefined
at /Applications/Atom.app/Contents/Resources/app/node_modules/github/lib/models/repository-states/present.js:775:45
at Generator.next ()
at step (/Applications/Atom.app/Contents/Resources/app/node_modules/github/lib/models/repository-states/present.js:84:197)
at /Applications/Atom.app/Contents/Resources/app/node_modules/github/lib/models/repository-states/present.js:84:367
at

My Atom is 1.27.2 version on Mac OS sierra
What should I do??
I’ve already fully deleted and reinstalled it twice but it didn’t help


#2

Hmmm. It’s a long shot, but you could try the beta version of Atom. Also, see what happens if you disable the github package.

BTW, what year was your computer made? It shouldn’t matter too much, I’m just interested. Mine’s late 2013 MacBook Pro, and I haven’t had any major issues yet (with any apps).


#3

Thanks! I fixed it by disabling github package. Mine is iMac late 2015. And I think I have this trouble because I had deleted the xcode git and reinstall it by homebrew few days ago.


#4

Sounds like there could be an obscure bug with the github package. Searching the repo issues, it seems similar bugs have cropped up


If you think you can identify or reproduce what caused the issue, it would probably help a lot. No pressure though; some bugs are just weird.


#5

One thing to check for that I’ve seen quite a bit of is if you might accidentally have initialized a git repository in your home directory? You can check with:

ls -l ~/.git

If that shows no file or directory found, then that’s not it but if there is a .git directory there and you didn’t git init in your home directory on purpose, then you can remove or rename the directory and see if that helps.


#6

Hi!

Atom CPU usage is between 80% and 100% on my last simple project (vue / node).

I already tried:

  • atom -safe: no change
  • atom --clear-window-state: no change
  • mv ~/.atom ~/.atom-backup: no change
  • Atom beta: no change

My config:
Atom: 1.28.2
Electron: 2.0.5
Chrome: 61.0.3163.100
Node: 8.9.3
Mac OS X Hight Sierra 10.13.5
Proc: 3.1 GHz Intel Core i7
Memory 16 GB

The weird thing is if I open one of my others vue/node projects, the cpu usage is around 10% so it’s something about my project.

I don’t have a git repository in my home, I don’t yet use git on this project, I tried to disable the git package. No luck.

I did a test with a clean project with vue-cli, so only “vue create hello-world” and when I open this project the CPU go up again around 100% (With Atom, Atom Beta, --safe, etc.)

So I tried to found some differences and the only one I found is when I’m using atom --profile-startup, I have an error message with projects with hight CPU (like the Hello world one) but no error with old vue project.

The error is:
commitCommentContainer_item.graphql.js:112 Uncaught (in promise) TypeError: Cannot read property ‘ahead’ of undefined
at Present.getAheadCount (/Applications/Atom.app/Contents/Resources/app/node_modules/github/lib/models/repository-states/present.js:615:44)
at

Maybe someone can help? :wink:


#7

Thanks for trying all those debugging steps :+1:

A few more questions:

  • Have you always seen this behavior or is it new with 1.28.2?
    *Do you see the high CPU usage just by opening a project (e.g. no files open and just leaving Atom idling)? Or do you need to do something specific with the project?
  • Can you share a public repository that I can test with?

Did you still see this message after disabling the GitHub package?


#8

Have you always seen this behavior or is it new with 1.28.2?
–> I only see this with 1.28.2 but that does not mean it’s a bug on this version because I did not test this kind of project with a previous version

Do you see the high CPU usage just by opening a project (e.g. no files open and just leaving Atom idling)? Or do you need to do something specific with the project?
–> Just by opening a project

Can you share a public repository that I can test with?
–> You can just do a “npm install -g @vue/cli” / “vue create hello-world”. If really essential I will share this repository

Did you still see this message after disabling the GitHub package?
–> Yes. Also I don’t use git on this project.


#9

So if you have no project open you don’t see the high CPU usage? Also, do you see the issue with any project or just a particular project?


#10

Hi,

I checked again my home and I had a git repository in my home. I deleted it and no more hight cpu usage with Atom!