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

Cannot install plugins using hyper i {plugin} #3500

Closed
2 tasks done
mikemcbride opened this issue Feb 26, 2019 · 35 comments · Fixed by #4086
Closed
2 tasks done

Cannot install plugins using hyper i {plugin} #3500

mikemcbride opened this issue Feb 26, 2019 · 35 comments · Fixed by #4086
Assignees
Labels
⌨️ CLI tool Issue or PR related to CLI tool 🐛 Type: Bug Issue pertains to something wrong within Hyper

Comments

@mikemcbride
Copy link

  • I am on the latest Hyper.app version
  • I have searched the issues of this repo and believe that this is not a duplicate

Issue

Using hyper i [plugin_name], I am getting the same error every time:

~ » hyper i hypercwd
/Applications/Hyper.app/Contents/Resources/bin/cli.js:19153
      getProperties = memoize(() => getParsedFile().program.body[0].expression.right.properties),
                                                                                    ^

TypeError: Cannot read property 'properties' of undefined
    at memoize (/Applications/Hyper.app/Contents/Resources/bin/cli.js:19153:85)
    at d (/Applications/Hyper.app/Contents/Resources/bin/cli.js:19138:22)
    at memoize (/Applications/Hyper.app/Contents/Resources/bin/cli.js:19154:34)
    at d (/Applications/Hyper.app/Contents/Resources/bin/cli.js:19138:22)
    at Object.install (/Applications/Hyper.app/Contents/Resources/bin/cli.js:19184:37)
    at Args.args.command (/Applications/Hyper.app/Contents/Resources/bin/cli.js:9934:45)
    at Args.runCommand (/Applications/Hyper.app/Contents/Resources/bin/cli.js:11318:37)
    at Args.module.exports [as parse] (/Applications/Hyper.app/Contents/Resources/bin/cli.js:15089:10)
    at main (/Applications/Hyper.app/Contents/Resources/bin/cli.js:9991:18)
    at Object.module.exports.name (/Applications/Hyper.app/Contents/Resources/bin/cli.js:10038:1)

It looks like this line is the offender, but I'm not sure what's causing the error. I have not yet tried building Hyper and running locally, but I could do that and add some logging to try and determine the root cause if there's not enough information here.

@mikemcbride
Copy link
Author

After running Hyper locally and modifying the cli/api.js file to log out some more info, it looks like the getProperties function is grabbing the wrong item from the parsed file. Inside of memoize:

() => getParsedFile().program.body[0].expression.right.properties

The object at index 0 doesn't have a right (nor a left) key. However, getParsedFile().program.body has two objects in the array, and the item at index 1 does have a right and a left. When I modify the function locally to use program.body[1] it works as expected.

I'm not sure where to go from there - it seems like maybe there's a way to detect if it's missing and try the other one, but I don't want to make too many assumptions. I'm not familiar enough with the internals here to guess as to why index 1 works and index 0 doesn't, so hopefully someone else knows why it might be happening.

@peterleif
Copy link

peterleif commented May 6, 2019

I have the same issue with Hyper 3.0.0, Windows 10 1809 with .hyper.js not modified.
hyper list, hyper install and hyper uninstall are not available.

Reinstalling Hyper (+ deletion of AppData\Roaming\Hyper and AppData\Local\hyper) does not solve the problem.

@ZaLiTHkA
Copy link

ZaLiTHkA commented May 6, 2019

another one here with the exact same message after updating to 3.0.0..

this does seem to be specifically CLI related though, because when I add the plugin names to my .hyper.js config file, the listed plugins install and activate without any issue.

@pcnate
Copy link

pcnate commented May 6, 2019

@peterleif @ZaLiTHkA this is possibly due to #3602

@peterleif
Copy link

peterleif commented May 6, 2019

@pcnate Thank you for sharing the information but actually isn't because I deleted old installations manually.

hyper version and the error message shows that 3.0.0 is running, but there may be some problem on the update process because the problem happened after an update from 2.1.2 to 3.0.0.

@mikemcbride
Copy link
Author

@pcnate @peterleif I also don't think that's the root cause. When I run hyper version I do get 3.0.0 yet I still experience the error.

@PowderFan87
Copy link

PowderFan87 commented May 6, 2019

I have the same problem. On Win10 with version 3.0.0
I used hyper for the first time today so being new to hyper, I thought I did something wrong.
Here is the full error I get

C:\Users\...\AppData\Local\hyper\app-3.0.0\resources\bin\cli.js:19153
getProperties = memoize(() => getParsedFile().program.body[0].expression.right.properties),
                                                                                    ^

TypeError: Cannot read property 'properties' of undefined
    at memoize (C:\Users\...\AppData\Local\hyper\app-3.0.0\resources\bin\cli.js:19153:85)
    at d (C:\Users\...\AppData\Local\hyper\app-3.0.0\resources\bin\cli.js:19138:22)
    at memoize (C:\Users\...\AppData\Local\hyper\app-3.0.0\resources\bin\cli.js:19154:34)
    at d (C:\Users\...\AppData\Local\hyper\app-3.0.0\resources\bin\cli.js:19138:22)
    at Object.install (C:\Users\...\AppData\Local\hyper\app-3.0.0\resources\bin\cli.js:19184:37)
    at Args.args.command (C:\Users\...\AppData\Local\hyper\app-3.0.0\resources\bin\cli.js:9934:45)
    at Args.runCommand (C:\Users\...\AppData\Local\hyper\app-3.0.0\resources\bin\cli.js:11318:37)
    at Args.module.exports [as parse] (C:\Users\...\AppData\Local\hyper\app-3.0.0\resources\bin\cli.js:15089:10)
    at main (C:\Users\...\AppData\Local\hyper\app-3.0.0\resources\bin\cli.js:9991:18)
    at Object.module.exports.name (C:\Users\...\AppData\Local\hyper\app-3.0.0\resources\bin\cli.js:10038:1)

I also installed it today for the first time on my mac. It works fine there.

@abrose
Copy link

abrose commented May 7, 2019

Same here, hyper 3.0.0. on Windows 10 (10.0.17763), trying to install plugins or themes results in the cannot read property error.

@rsuarezgonza
Copy link

It seems a problem with webpack dependeciy as is described in this link webpack

@Stanzilla Stanzilla added the 🐛 Type: Bug Issue pertains to something wrong within Hyper label May 7, 2019
@bmagyarkuti
Copy link

Here's another confirmation running hyper 3.0.0 on Windows 10.

@seergiioo6
Copy link

Same issue here

@ZaLiTHkA
Copy link

ZaLiTHkA commented May 7, 2019

here's an interesting one... in trying to help debug a different issue, I managed to get hyper install to work on 3.0.0. O.o the details of what I did are over here. the only point not mentioned explicitly in that comment is that I didn't rely on the built-in auto updater, but rather downloaded the exe from the website.

however, I'm not entirely sure if it's actually working properly..

my $APPDATA/Hyper/.hyper.js file currently has:

plugins: [
  'hyper-website-theme',
  'hyper-yes',
  'hyper-single-instance'
]

but hyper list shows me:

Andre@Monstrosity MINGW64 ~
$ hyper list
hyper-website-theme
hypercwd

any suggestions on how to verify which plugins are actually installed?

@Machine-Maker
Copy link

Machine-Maker commented May 7, 2019

@ZaLiTHkA so the actual list of plugins installed are in %APPDATA%/Hyper/.hyper.js Im guessing its reading the list of plugins in %USERPROFILE%/.hyper.js not the actual list of plugins.

But yeah, the CLI isnt working for me either (hyper version shows 3.0.0) but just adding the plugin to the .hyper.js file works fine.

@revic1993
Copy link

revic1993 commented May 7, 2019

Its happening with every hyper command not only install, getting the same error with hyper list

@ZaLiTHkA
Copy link

ZaLiTHkA commented May 7, 2019

@ZaLiTHkA so the actual list of plugins installed are in %APPDATA%/Hyper/.hyper.js Im guessing its reading the list of plugins in %USERPROFILE%/.hyper.js not the actual list of plugins.

aha, you're dead on there.. $USERPROFILE/.hyper.js currently has:

plugin: ['hyper-webite-theme', 'hypercwd']

@ZaLiTHkA
Copy link

ZaLiTHkA commented May 7, 2019

I just managed to reproduce the TypeError: Cannot read property 'properties' of undefined error from the OP..

I renamed both $APPDATA/Hyper/.hyper.js and $USERPROFILE/.hyper.js files and relaunched Hyper, at which point it only recreated $APPDATA/Hyper/.hyper.js and hyper list started throwing this error.

I then updated the new file with my personal settings and copied it over to $USERPROFILE/.hyper.js and the CLI commands started working again.

hope that helps a bit. O.o

@revic1993
Copy link

@ZaLiTHkA wow that worked perfectly! Thanks

@mikemcbride
Copy link
Author

FWIW, I just completely uninstalled Hyper, downloaded the latest from the website, and tried this again but got the same results as before.

@xxmlud
Copy link

xxmlud commented May 7, 2019

I just managed to reproduce the TypeError: Cannot read property 'properties' of undefined error from the OP..

I renamed both $APPDATA/Hyper/.hyper.js and $USERPROFILE/.hyper.js files and relaunched Hyper, at which point it only recreated $APPDATA/Hyper/.hyper.js and hyper list started throwing this error.

I then updated the new file with my personal settings and copied it over to $USERPROFILE/.hyper.js and the CLI commands started working again.

hope that helps a bit. O.o

Hi,

@ZaLiTHkA Thanks!.

I have executed this, but to apply the changes in the $APPDATA/Hyper/.hyper.js file have created a symbolic link.

Example:

C:\Users\user>mklink "C:\Users\user\.hyper.js" "C:\Users\user\AppData\Roaming\Hyper\.hyper.js"
vínculo simbólico creado para C:\Users\user\.hyper.js <<===>> C:\Users\user\AppData\Roaming\Hyper\.hyper.js

C:\Users\user>dir | findstr "hyper"
07/05/2019  22:39    <SYMLINK>      .hyper.js [C:\Users\user\AppData\Roaming\Hyper\.hyper.js]

@ZaLiTHkA
Copy link

ZaLiTHkA commented May 8, 2019

oh awesome, I didn't think of using a symlink yesterday, but that actually works perfectly. thanks. :)


for the project maintainers: it seems like the Hyper app itself and the hyper CLI command are looking at different paths for the config file, but in the meantime, creating a symlink as @xxmlud has suggested now seems like a good workaround:

Andre@Monstrosity MINGW64 ~
$ hyper list
hyper-website-theme
hypercwd
hyper-yes
hyper-single-instance

Andre@Monstrosity MINGW64 ~
$ hyper install hyper-search
hyper-search installed successfully!

Andre@Monstrosity MINGW64 ~
$ hyper list
hyper-website-theme
hypercwd
hyper-yes
hyper-single-instance
hyper-search

@voronoipotato
Copy link

This fails for me on a fresh install. Google brought me here. How can we find where cli looks for the .hyper.js vs where the terminal looks for it?

@ZaLiTHkA
Copy link

ZaLiTHkA commented May 8, 2019

@voronoipotato, try the symbolic link idea that @xxmlud posted just two comments before you. That should help until it's fixed in the app.

@voronoipotato
Copy link

I'm a new user so I've not actually gotten to see it working. I'm just going to wait till it's fixed :) but I'm happy to help fix it.

https://github.com/zeit/hyper/blob/2d399baa87fa52388d3d25719dce3678842e2c56/app/index.js#L4

https://github.com/zeit/hyper/blob/27c1893fb82dde78b5686c9034ac3268395198f2/cli/api.js#L9

This looks somewhat promising.

@mikemcbride
Copy link
Author

mikemcbride commented May 9, 2019

I'm seeing a lot of users reporting that @ZaLiTHkA's solution with a symlink worked for them. AFAIK, that's only going to work for Windows users. For those of us on macOS, I'm not sure of a similar solution. I did a search for a .hyper.js file in the app's packaged contents and found nothing, so I don't think we're able to do a similar symlink.

Anyone else on macOS found a workaround?

@yamamel
Copy link

yamamel commented May 10, 2019

I installed hyper today, and I met the same problem. However, after I add the same variables to the System variables and restart the computer. the command like hyper i hypercwd, it worked. Though I don't why, I hope this may help you.

@ZaLiTHkA
Copy link

@mikemcbride I'm more of a Windows/Linux guy myself, but we do have a Mac here at work that I use quite often, I'll see if I can work out the file locations just now.. so unless you come right in the meantime, I might have some more info for you on that shortly.

@jjakj1 there was a 3.0.2 update released a few hours back that includes a fix for the config file paths, but as far as I understand this is only fixed from the setup package... so I believe if you did a fresh install as opposed to an in-place update, then in theory you shouldn't have this problem.

@PowderFan87
Copy link

PowderFan87 commented May 10, 2019

Update to 3.0.2 fixed the issue for me. I can now install plugins :D love it!!! Nice quick reaction!!!

@oscu0
Copy link

oscu0 commented Jun 27, 2019

Not fixed for me @ 3.0.2, macOS. I've tried making the config file a symlink - didn't help.

@theguly
Copy link

theguly commented Sep 11, 2019

hi there, bumping this because i have the same issue on a linux box with 3.0.2.

@Stanzilla Stanzilla added the ⌨️ CLI tool Issue or PR related to CLI tool label Oct 10, 2019
@Stanzilla
Copy link
Collaborator

@voronoipotato would you like to work on this issue and make a PR?

@Ornataweaver
Copy link

I have the same problem here.
macOS Mojave Version 10.14.6

$  hyper i hyper-pane
/Applications/Hyper.app/Contents/Resources/bin/cli.js:19156
      getProperties = memoize(() => getParsedFile().program.body[0].expression.right.properties),
                                                                                    ^

TypeError: Cannot read property 'properties' of undefined
    at memoize (/Applications/Hyper.app/Contents/Resources/bin/cli.js:19156:85)
    at d (/Applications/Hyper.app/Contents/Resources/bin/cli.js:19141:22)
    at memoize (/Applications/Hyper.app/Contents/Resources/bin/cli.js:19157:34)
    at d (/Applications/Hyper.app/Contents/Resources/bin/cli.js:19141:22)
    at Object.install (/Applications/Hyper.app/Contents/Resources/bin/cli.js:19187:37)
    at Args.args.command (/Applications/Hyper.app/Contents/Resources/bin/cli.js:9934:45)
    at Args.runCommand (/Applications/Hyper.app/Contents/Resources/bin/cli.js:11318:37)
    at Args.module.exports [as parse] (/Applications/Hyper.app/Contents/Resources/bin/cli.js:15089:10)
    at main (/Applications/Hyper.app/Contents/Resources/bin/cli.js:9991:18)
    at Object.module.exports.name (/Applications/Hyper.app/Contents/Resources/bin/cli.js:10038:1)

@Ornataweaver
Copy link

$  hyper list
/Applications/Hyper.app/Contents/Resources/bin/cli.js:19156
      getProperties = memoize(() => getParsedFile().program.body[0].expression.right.properties),
                                                                                    ^

TypeError: Cannot read property 'properties' of undefined
    at memoize (/Applications/Hyper.app/Contents/Resources/bin/cli.js:19156:85)
    at d (/Applications/Hyper.app/Contents/Resources/bin/cli.js:19141:22)
    at memoize (/Applications/Hyper.app/Contents/Resources/bin/cli.js:19157:34)
    at d (/Applications/Hyper.app/Contents/Resources/bin/cli.js:19141:22)
    at Object.list (/Applications/Hyper.app/Contents/Resources/bin/cli.js:19205:26)
    at Args.args.command (/Applications/Hyper.app/Contents/Resources/bin/cli.js:9943:15)
    at Args.runCommand (/Applications/Hyper.app/Contents/Resources/bin/cli.js:11318:37)
    at Args.module.exports [as parse] (/Applications/Hyper.app/Contents/Resources/bin/cli.js:15089:10)
    at main (/Applications/Hyper.app/Contents/Resources/bin/cli.js:9991:18)
    at Object.module.exports.name (/Applications/Hyper.app/Contents/Resources/bin/cli.js:10038:1)

@vivekrp
Copy link

vivekrp commented Dec 17, 2019

Looks like it's fixed in 3.0.2. Initially after updating and also reinstalling was getting the same error "TypeError: Cannot read property 'properties' of undefined" but then I deleted .hyper.js file in Home Directory, deleted /usr/local/bin/hyper and resintalled Hyper and modified .hyper.js (don't replace old one, just modify the new file) now it's all smooth.

hyper i, hyper list all working fine now.

OS version and name: macOS Mojave 10.15.2
Hyper.app version: 3.0.2

@mikemcbride
Copy link
Author

The 3.0.2 release did not seem to work for me (as others above also reported). I was able to get this working locally by modifying the cli.js file and cut a PR with the change. I'm not sure if it's the right approach but it does seem to fix the issue... 🤞

@zenyr
Copy link

zenyr commented Mar 19, 2023

  • My main device is OSX so I had no issues until today, the day I randomly decided to install Hyper.app to my gaming PC
  • Windows 10
    • Installed using Scoop's extra bucket
    • edit: please don't use Scoop's installer btw. It makes things COMPLICATED. Once you run the hyper it will migrate into %appdata% automatically so run scoop uninstall hyper after running hyper once.
  • I switched to Powershell using hyper's config file
  • Now hyper nags me everytime I launch, that it migrated my config file
    • okay...
    • now I keep %appdata%/.hyper.js and remove all the old .backup config files
      • Namely C:\Users\zenyr\AppData\Roaming\Hyper\.hyper.js
    • messages are now gone and it's working fine! yay!
  • Now let's customize my hyper
    PS C:\Users\zenyr> hyper i hypercwd
          getProperties = memoize(() => getParsedFile().program.body[0].expression.right.properties),
    
    TypeError: Cannot read property 'properties' of undefined
        at memoize (C:\Users\zenyr\AppData\Local\hyper\app-2.0.0\resources\bin\cli.js:19133:85)
          (*snip*)
        at Object.<anonymous> (C:\Users\zenyr\AppData\Local\hyper\app-2.0.0\resources\bin\cli.js:10035:1)
    
    About screen
  • Nearly every hyper * commands won't work
  • Found this article

The Workaround™️

  • Open CMD as Administrator
    • (I manually switched to ye-old CMD because powershell uses different syntax to make a symlink and IDK that 🤷)
    PS C:\Users\zenyr> cd $env:userprofile # if required
    PS C:\Users\zenyr> cmd
    Microsoft Windows [Version 10.0.19045.2728]
    (c) Microsoft Corporation. All rights reserved.
    
    C:\Users\zenyr>del .hyper.js # if required
    C:\Users\zenyr>mklink .hyper.js "%appdata%\Hyper\.hyper.js"
    .hyper.js <<===>> C:\Users\zenyr\AppData\Roaming\Hyper\.hyper.js에 대한 기호화된 링크를 만들었습니다. # cp949 ftw ymmv
    
  • Now everything works as intended 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⌨️ CLI tool Issue or PR related to CLI tool 🐛 Type: Bug Issue pertains to something wrong within Hyper
Projects
None yet
Development

Successfully merging a pull request may close this issue.