hyper: Cannot install plugins using `hyper i {plugin}`

  • 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.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 35

Most upvoted comments

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.

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

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.

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]

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

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

$  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)

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… 🤞

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

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

@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.

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

@ZaLiTHkA wow that worked perfectly! Thanks

@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']

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.