kit icon indicating copy to clipboard operation
kit copied to clipboard

Kit crashes after launching on Apple M1 Pro / Monterey 12.4

Open jmlivingston opened this issue 2 years ago • 34 comments

I was really hoping to start playing with this as I've been a long time follower of your work, but unfortunately after installing and running, it simply crashes. Not sure if this is a problem with it running on Apple Silicon or something else, but thought I'd share.

Note: I'm on vacation for a week after tomorrow, but I'd be happy to provide any logging if you can tell me where to find it.

Steps

  • Install ScriptKit. (Copy to Applications folder)
  • Run ScriptKit

Expected ScriptKit runs

Actual Splash screen shows briefly then closes.

https://user-images.githubusercontent.com/1093719/178078759-ebf975e5-d46c-4262-8014-0acf0c0da64a.mp4

jmlivingston avatar Jul 08 '22 22:07 jmlivingston

Few things to check:

Do you see any "Kit" processes in your activity monitor?

Did it create a '~/.kit' directory?

Is there a '~/.kit/logs/kit.log'?

johnlindquist avatar Jul 08 '22 22:07 johnlindquist

I am having the same issue with the Apple Silicon, which I installed first. Then I attempted to install the Intel version. Here is my log file.

kit.log

cynthiateeters avatar Jul 09 '22 03:07 cynthiateeters

@cynthiateeters Thanks for the log!

Do you see the Kit icon in the menubar or any "Kit" processes running in activity monitor? The logs look like everything is set up correctly...

johnlindquist avatar Jul 09 '22 04:07 johnlindquist

Yes, here is the activity monitor:

Screen Shot 2022-07-09 at 12 10 11 AM

cynthiateeters avatar Jul 09 '22 04:07 cynthiateeters

@cynthiateeters thx, do you see the icon in the menubar? Does the cmd+; shortcut work for you?

johnlindquist avatar Jul 09 '22 04:07 johnlindquist

I think I found it. Looks like someone pushed a change to an @octokit package which is silently causing the dependency install step to fail. I'll figure it out and lock the versions to avoid this in the future:

➜  .kit ~/.knode/bin/npm i
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: @johnlindquist/[email protected]
npm ERR! Found: @octokit/[email protected]
npm ERR! node_modules/@octokit/core
npm ERR!   @octokit/core@"^3.6.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @octokit/core@">=4" from @octokit/[email protected]
npm ERR! node_modules/@octokit/plugin-paginate-rest
npm ERR!   @octokit/plugin-paginate-rest@"^2.17.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /Users/johnlindquist/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/johnlindquist/.npm/_logs/2022-07-09T04_08_34_221Z-debug-0.log

I'll get it sorted tonight and push out another build ASAP.

johnlindquist avatar Jul 09 '22 04:07 johnlindquist

Thanks!! 😄

cynthiateeters avatar Jul 09 '22 04:07 cynthiateeters

@cynthiateeters If you'd like to fix it or just curious:

  1. Open ~/.kit/package.json, a remove the ^ from this line:

Before:

"@octokit/plugin-paginate-rest": "^2.17.0",

After:

"@octokit/plugin-paginate-rest": "2.17.0",

(You can see in their releases that they pushed a 2.x.x version which updated to @octokit/core v4 which is what's breaking our install since we have a @octokit/core at v3)

  1. Terminate any Kit processes in activity monitor.

  2. Install the packages in the terminal

cd ~/.kit && ~/.knode/bin/npm i
  1. Then re-open Kit.app and everything should work fine.

(I'm working on the pushing the fix tonight regardless)

johnlindquist avatar Jul 09 '22 04:07 johnlindquist

Alright, I pushed out the new build on scriptkit.com. It the auto-updater might still work, but if not, here's direct links for convenience.

(Please make sure to end and running Kit processes before starting the new install)

m1: https://github.com/johnlindquist/kitapp/releases/download/v1.20.5/Kit-1.20.5-arm64.dmg Intel: https://github.com/johnlindquist/kitapp/releases/download/v1.20.5/Kit-1.20.5.dmg

Thanks again for bringing this to my attention. The versions are locked now, so this type of error shouldn't ever happen again.

johnlindquist avatar Jul 09 '22 08:07 johnlindquist

I had to get rid of everything that was previously there before the new install. It's working. Thanks!

cynthiateeters avatar Jul 09 '22 18:07 cynthiateeters

Guess I called success too soon. I tried the Dad Joke example. I got a joke read to me and then the window disappeared and I can't get it to come back.

kit.log

cynthiateeters avatar Jul 09 '22 18:07 cynthiateeters

@cynthiateeters Hmm, that log looks fine.

  1. Can you post this log? ~/Library/Logs/Kit/main.log
  2. Is the menubar icon still visible?
  3. Are there any "Kit" processes running in the activity monitor?

johnlindquist avatar Jul 09 '22 18:07 johnlindquist

main.log

cynthiateeters avatar Jul 09 '22 18:07 cynthiateeters

Menu bar icon is visible

cynthiateeters avatar Jul 09 '22 18:07 cynthiateeters

Screen Shot 2022-07-09 at 2 34 36 PM

cynthiateeters avatar Jul 09 '22 18:07 cynthiateeters

If you run:

tail -f ~/.kit/logs/kit.log

Then hit cmd+; or Open Kit.app prompt

CleanShot 2022-07-09 at 12 49 06

Do you see the kit.log updating?

johnlindquist avatar Jul 09 '22 18:07 johnlindquist

OK, maybe I didn't understand how this works. The kit window disappears if I do anything else and will not reappear when I click on the icon in the menu bar.

It does, though, reappear when I hit cmd+;.

If this is wanted behavior, I can live with that.

Screen Shot 2022-07-09 at 3 28 39 PM

cynthiateeters avatar Jul 09 '22 19:07 cynthiateeters

Do you see this menu when click on the icon in the menubar? The first option "Open Kit.app prompt" should open the main window again. If not, then something's broken...

CleanShot 2022-07-09 at 14 06 47

johnlindquist avatar Jul 09 '22 20:07 johnlindquist

No, I do not see that come up.

cynthiateeters avatar Jul 09 '22 20:07 cynthiateeters

  1. Which osx version are you on?
  2. Are you using multiple monitors?

I'm having trouble reproducing 🤔

johnlindquist avatar Jul 09 '22 20:07 johnlindquist

macos

cynthiateeters avatar Jul 10 '22 17:07 cynthiateeters

Sorry I am very slow to reply. Yes, I have multiple monitors.

cynthiateeters avatar Jul 10 '22 20:07 cynthiateeters

I have a similar issue that the main window is not showing up. Although when I search blindly for a script to run, this script then works: e.g. the dad jokes

https://user-images.githubusercontent.com/23639869/183416461-518b8375-7dc8-4072-a814-edb2c2b99bc5.mp4

I am on Monterey 12.5

MoritzBru avatar Aug 08 '22 12:08 MoritzBru

@MoritzBru

Try cmd+0 after the main shortcut. That will reset prompt positions in case a monitor/resolution changed where prompt positions get cached.

(My first guess is that it's appearing off-screen)

johnlindquist avatar Aug 08 '22 12:08 johnlindquist

@johnlindquist same happend to me just now.

it feels like it has something to do with my 2nd screen. scriptKit did not 'not' show up when no 2nd screen attached. after clicking the scriptKit icon and then hitting cmd+0, scriptKit appeared again. closing the scriptKit and triggering scriptKit with cmd-; worked again.

joelgrimberg avatar Sep 23 '22 14:09 joelgrimberg

The upcoming build has a fix where the prompt checks if it's "in-bounds" of the screen dimensions and will correct itself if not.

It should take care of these scenarios where the position caching conflicts with osx moving displays around when monitors connect/move/whatever

johnlindquist avatar Sep 23 '22 15:09 johnlindquist

I'm experiencing the same issue @jmlivingston originally reported.

Steps I've taken so far:

  1. Install Silicon build (v1.20.5) from the site. (I'm on Monterey 12.6, and I have never installed Script Kit on this machine before.)
  2. Copy Kit into Applications.
  3. Open Kit.
  4. Splash screen appears, makes it to updating ~/.kit packages... and then crashes before I can fill out the form. (This happens every I open the app.)

Notes to address questions raised in previous comments:

  • I was initially on an external monitor, but after reading the previous comments I tried it without any monitors plugged in and experienced the same issue.
  • While the splash screen is visible, the icon appears in the menu bar and Kit processes are visible in Activity Monitor. When the window closes, everything goes away.
  • I do have a ~.kit directory now. (It seems to be re-created every time I open the app.)

Here's my log file:

main.log

This seems to be the relevant portion (repeated for every open attempt):

[2022-09-23 15:47:35.356] [warn] Error: Install not verified...
    at /Applications/Kit.app/Contents/Resources/app.asar/main.prod.js:2:232959
    at tryCatch (/Applications/Kit.app/Contents/Resources/app.asar/node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:63:40)
    at Generator.invoke [as _invoke] (/Applications/Kit.app/Contents/Resources/app.asar/node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:294:22)
    at Generator.next (/Applications/Kit.app/Contents/Resources/app.asar/node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:119:21)
    at sc (/Applications/Kit.app/Contents/Resources/app.asar/main.prod.js:2:218059)
    at a (/Applications/Kit.app/Contents/Resources/app.asar/main.prod.js:2:218263)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
[2022-09-23 15:47:35.378] [info] Hiding because undefined

This sounds almost like a macOS security issue? Do I need to grant privileges to it somewhere in System Preferences? But I can't tell from the log whether the "install" in question is the Kit app or my OS, or where the error is coming from. Hopefully you have more insight there! Let me know if you need me to provide additional details.

acrobertson avatar Sep 23 '22 20:09 acrobertson

@acrobertson thanks for the log, looks like

{ npmResult: 'Deps install exit code 127' }

is the important bit.

Does ~/.knode/bin/ exist on your machine? I think it's failing because it can't find ~/.knode/bin/npm to install the packages in ~/.kit

johnlindquist avatar Sep 23 '22 20:09 johnlindquist

Ah, interesting! Sidenote: immediately after posting I realized I hadn't searched the Discussions (sorry about that) and found this post there with the same issue. But the suggested scripts didn't work for me because I don't have a ~/.kit/node directory. Was that moved to ~/.knode?

Regardless, I do actually have a ~/.knode/bin/npm, which I guess is strange.

Contents of my ~/.knode/bin directory which does exist

Do I need to edit my $PATH? I don't see it in there.

acrobertson avatar Sep 23 '22 20:09 acrobertson

@acrobertson

No, you shouldn't need to edit your $PATH, Script Kit should set temp paths internally.

Hmm, does this throw any errors?

(This is manually doing the step the app attempts during startup)

cd ~/.kit
PATH=~/.knode/bin:$PATH npm i

johnlindquist avatar Sep 23 '22 20:09 johnlindquist