hyper icon indicating copy to clipboard operation
hyper copied to clipboard

Plugin error! "hypurr" when decorating decorateConfig

Open chrionix opened this issue 2 years ago • 20 comments

As per the subject, I've tried with and without version numbers, with no success.

chrionix avatar Jan 14 '23 11:01 chrionix

can you please explain what are you trying to do and also paste the whole error

asrvd avatar Jan 14 '23 13:01 asrvd

The error occurs on the latest 4.x.x canary builds, probably because of a breaking change somewhere.

sharpenedblade avatar Jan 14 '23 22:01 sharpenedblade

The error occurs on the latest 4.x.x canary builds, probably because of a breaking change somewhere.

will look into it

asrvd avatar Jan 15 '23 02:01 asrvd

@chrionix @sharpenedblade i dont think i can do anything about it for now, i doubt that it may break things for people not using the canary build, do you guys have any suggestions?

asrvd avatar Jan 15 '23 14:01 asrvd

moreover, documentation for the canary build is nowhere to be found :(

asrvd avatar Jan 15 '23 14:01 asrvd

Actually it sometimes happens on the latest stable.

moreover, documentation for the canary build is nowhere to be found :( The only docs are in the release notes for now.

sharpenedblade avatar Jan 16 '23 03:01 sharpenedblade

I am using macos, could it be related.

sharpenedblade avatar Jan 16 '23 03:01 sharpenedblade

I am using macos, could it be related.

not really sure, i use windows and haven't got any errors 🤔 will need more context on this

asrvd avatar Jan 16 '23 04:01 asrvd

closed by mistake, will leave this open so that more people can report this

asrvd avatar Jan 16 '23 04:01 asrvd

So I tried to get logs, but when I open the devtools console, I dont see any errors.

sharpenedblade avatar Jan 16 '23 17:01 sharpenedblade

After some investigation, I realized that the error happens when catppuccinTheme is not set in your config. The canary build moved to json config, so it could be related.

The error comes from

const theme = palettes[config.catppuccinTheme.toLowerCase() || "macchiato"];

in decorateConfig in index.js

sharpenedblade avatar Jan 16 '23 17:01 sharpenedblade

After messing with the new config file, I discovered that setting catppuccinTheme in the config file, then restarting hyper makes this plugin work. I think the README should tell people that they have to set catppuccinTheme, because right now its makes it seem optional.

sharpenedblade avatar Jan 16 '23 17:01 sharpenedblade

After messing with the new config file, I discovered that setting catppuccinTheme in the config file, then restarting hyper makes this plugin work. I think the README should tell people that they have to set catppuccinTheme, because right now its makes it seem optional.

alright, thanks a lot for helping out, really appreciate this ❤️

asrvd avatar Jan 17 '23 14:01 asrvd

@chrionix can you check and let us know if you have set the catppuccinTheme in your config file?

asrvd avatar Jan 17 '23 14:01 asrvd

I think this might solve the issue -

const themeName = config.catppuccinTheme ? config.catppuccinTheme.toLowerCase() : "macchiato";
const theme = palettes[themeName];

previously I was doing -

const theme = palettes[config.catppuccinTheme.toLowerCase() || "macchiato"];

asrvd avatar Jan 17 '23 14:01 asrvd

the thing is, in the stable builds even not setting the catppuccinTheme works, not really sure what they are doing differently in canary version

asrvd avatar Jan 17 '23 14:01 asrvd

the thing is, in the stable builds even not setting the catppuccinTheme works, not really sure what they are doing differently in canary version

It doesn't work in the latest stable for me. Are you using 3.4.1?

sharpenedblade avatar Jan 17 '23 15:01 sharpenedblade

Just wanted to note that I get the same error and that adding catppuccinTheme to the config file does make the error go away.

ccubed avatar Jan 18 '24 19:01 ccubed

Also confirming that adding catppuccinTheme to the config fixes this for Hyper 3.4.1.

I would update https://github.com/catppuccin/hyper/blob/8281b8f7f872c57308614de741da987dc119a71d/index.js#L107

to

  const theme =  palettes[config.catppuccinTheme ? config.catppuccinTheme.toLowerCase()] || palettes.macchiato;

ldeveber avatar Feb 17 '24 14:02 ldeveber

Hello, I just added the plugin to Hyper but it is not working... I added decorateconfig manually to index.js but my terminal is still using the default theme...

Hororohoruru avatar Mar 23 '24 17:03 Hororohoruru

Hey 👋,

I've merged #15 which overhauls the repository and modifies the installation to only apply the colours and not touch the layout/CSS. Please see the README for the new installation instructions.

sgoudham avatar Mar 01 '25 00:03 sgoudham