prenagha / launchbar

LaunchBar Actions
https://renaghan.com/launchbar/
Apache License 2.0
182 stars 13 forks source link

Action Updates: TypeError: undefined is not a function (evaluating 'actionPackage.endsWith(".lbaction")') (line 83) #3

Closed hlissner closed 9 years ago

hlissner commented 9 years ago

Happens on first-run.

Console shows:

2015-09-11 9:58:29.879 PM LaunchBar[593]: Action Updates (com.renaghan.launchbar.Updates): Download dir /Users/hlissner/Downloads

2015-09-11 9:58:29.880 PM LaunchBar[593]: Action Updates (com.renaghan.launchbar.Updates): Checking actions in /Users/hlissner/Library/Application Support/LaunchBar/Actions

2015-09-11 9:58:29.882 PM LaunchBar[593]: Action Updates (com.renaghan.launchbar.Updates): Unhandled Exception in script "updates.js": TypeError: undefined is not a function (evaluating 'actionPackage.endsWith(".lbaction")') {
    column = 30;
    line = 83;
}

Running Updates 1.0 with LB 6.4.1 on Yosemite 10.10.5.

I'll do some more debugging in the morning.

prenagha commented 9 years ago

odd, not sure how actionPackage could be null, since it comes from a contents of directory method. Regardless I have updated the action v1.1 1a2650f5b81ac974b852960c888a63111530736c to log the action package and to skip if it is null for some reason. let me know if that solves this.

prenagha commented 9 years ago

I am running LB 6.4.1 on OS X 10.11 El-Capitan GM. hopefully that won't matter

hlissner commented 9 years ago

It didn't solve the problem unfortunately, same error, line 84. I'll dig a little to rule out my environment.


On a separate note, maybe this should go into another issue, but File.getDirectoryContents doesn't seem to like symlinks. My ~/Library/Application Support/LaunchBar/Actions was symlinked to a Dropbox backup, causing the error: The file "Actions" couldn't be opened..

prenagha commented 9 years ago

You probably need to set ActionsDir in the prefs file to point at the real directory then. v1.3 d3ef885c25fde90e91ff88c3a921f4714b2577fe now sets up default actions and gives you an edit pref item within action

hlissner commented 9 years ago

Gotcha. Though, the original issue (actionPackage == undefined) still exists. I'll look more into it once I get home.

prenagha commented 9 years ago

I added a typeof(actionPackage) == 'string' condition so hopefully whatever getDirectoryContents was returning will be skipped now

prenagha commented 9 years ago

I notified Objective Dev folks about getDirectoryContents when given symlink bug

prenagha commented 9 years ago

@hlissner in v2.2 i removed startsWith and endsWith methods. Seems like those aren't universally supported in javascript so that may be the problem. Please download latest and retry.