jccguimaraes / atom-project-viewer

Project Viewer - An Atom's package
MIT License
75 stars 15 forks source link

Uncaught TypeError: atom.getStorageFolder is not a function #190

Closed skratchdot closed 6 years ago

skratchdot commented 6 years ago

[Enter steps to reproduce:]

  1. Open 1.25.0-beta0 x64
  2. Try to switch projects

Atom: 1.25.0-beta0 x64 Electron: 1.7.11 OS: Mac OS X 10.13.3 Thrown From: project-viewer package 1.3.0

Stack Trace

Uncaught TypeError: atom.getStorageFolder is not a function

At /Users/[myusername]/.atom/packages/project-viewer/src/project-view.js:290

TypeError: atom.getStorageFolder is not a function
    at /packages/project-viewer/src/project-view.js:290:10)
    at HTMLLIElement._onClickEvent (/packages/project-viewer/src/project-view.js:17:8)

Commands

Non-Core Packages

atom-beautify 0.30.9 
atom-ternjs 0.18.3 
atom-typescript 12.1.2 
busy-signal 1.4.3 
color-picker 2.2.5 
docblockr 0.13.6 
editorconfig 2.2.2 
file-icons 2.1.16 
git-time-machine 1.5.9 
hyperclick 0.1.5 
intentions 1.1.5 
js-hyperclick 1.13.0 
language-babel 2.83.3 
language-pegjs 0.5.0 
language-rust 0.4.12 
linter 2.2.0 
linter-eslint 8.4.1 
linter-flow 5.6.1 
linter-rust 0.8.4 
linter-tslint 1.9.0 
linter-ui-default 1.6.10 
local-history 4.3.1 
minimap 4.29.7 
platformio-ide-terminal 2.8.0 
prettier-atom 0.50.0 
project-viewer 1.3.0 
sort-lines 0.18.0 
skratchdot commented 6 years ago

Looks like the atom API has changed here: https://github.com/atom/atom/commits/master/src/atom-environment.js

This commit actual removes the function: https://github.com/atom/atom/commit/744ae36f31762247bc8fdc9b8d62a6b6be925b70#diff-2ac335175125a7c7650f50d471076aa1

But I'm still looking through the other changes to see what the updated API for this is.

jccguimaraes commented 6 years ago

oh, my! Thanks @skratchdot Will sure try to tackle this issue.

gregaltuna commented 6 years ago

Howdy all... pretty new to Atom as well as command line stuff, but am comfortable enough to do it if given the right direction.

How do I go about patching that file on my computer? I can't seem to find it. Am I missing something? Any and all comments are much appreciated...

gregaltuna commented 6 years ago

PS... I cloned and found the file in the repo. Just not sure how it applies or where it exists on my computer.

gregaltuna commented 6 years ago

OMG! Pat this newb on the back, please. I realized that I could run atom from the command line. It's not opening beta, but it works and now I see my project viewer is working again as well. Sorry for all my whining!!

skratchdot commented 6 years ago

@gregaltuna - Yes- I've been using atom ever since this bug popped up. I used to use atom-beta regularly, but it is not compatible with atom-project-viewer.

newelement commented 6 years ago

This has popped back up with Atom 1.25.0

skratchdot commented 6 years ago

Yeah- It was only ever in version 1.25.x. I'm going to have to not update until this is fixed (and stay on 1.24.1).

jccguimaraes commented 6 years ago

hey guys, will try to fix this, they dropped that method. So I need to investigate another alternative. Sorry. Will try to be as fast as I can

newelement commented 6 years ago

@jccguimaraes Does getPath() and setPath() help? https://electronjs.org/docs/api/app#appgetpathname

newelement commented 6 years ago

I used stateStore.save() and stateStore.load() to fix the issue locally until an official release.

skratchdot commented 6 years ago

@newelement - you should submit a PR if it fixes the issue! 🥇

newelement commented 6 years ago

It's ugly but it does work :-)

jccguimaraes commented 6 years ago

hey! If you intend to open a PR which I encourage you 👍 I think stateStore with save and load is the way at the moment. Keep in mind that they are Promises.

But if you don't want to please tell! Great troubleshooting!

camlafit commented 6 years ago

reproduced here with last stable atom version 1.25 (on debian)

jccguimaraes commented 6 years ago

Today I will send the fix to this

linjialiang commented 6 years ago

It was not until today that I found this problem @jccguimaraes

Reslinator commented 6 years ago

Great. Thank you @jccguimaraes.

camlafit commented 6 years ago

perfect here :) thanks a lot