question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Chrome applescript execution error

See original GitHub issue

When running npm run start on an ejected Create React App app, several minutes pass with it just sitting on Starting the development server... before finally displaying:

/path/to/scripts/utils/chrome.applescript:81:99: execution error: Google Chrome Canary got an

(not a typo, the message cuts off there).

Despite this warning message, the build does compile successfully, it just doesn’t open in-browser.

I realize I may have voided my warranty by ejecting, and this isn’t a high priority issue anyway. For anyone else encountering it, you can circumvent the lengthy timeout process by erasing the code in chrome.applescript; you’ll lose the auto-open functionality, but that’s not a big deal.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
gaearoncommented, Sep 1, 2016

Closing for the lack of information.

If somebody experiences this please try to figure out a way to reproduce (e.g. take note of which windows are open, whether you are using stable or canary, etc).

0reactions
joshwcomeaucommented, Aug 23, 2016

Sorry for the delay!

Alright, so: it was still reproducible after creating a new project with master. I decided to muck about in the applescript, and the issue is no longer occurring, but I have no idea why o_O.

Details:

I updated create-react-app from GitHub’s maser branch, created a new project, and ran npm run start. After 3-4 minutes of “Starting the development server…”, a new browser tab opens and everything works. This is the case regardless of whether or not I’ve ejected.

When I cleared the contents of chrome.applescript, start-up time was much much faster; a few seconds instead of a few minutes.

Next, in the applescript, I tried to remove the loop that looks for pre-existing tabs. This had no effect.

Then, I simplified the logic at the bottom, from:

    if found then
      tell theTab to reload
      set index of theWindow to 1
      set theWindow's active tab index to theTabIndex
    else
      tell window 1
        activate
        make new tab with properties {URL:theURL}
      end tell
    end if

to:

      tell window 1
        activate
        make new tab with properties {URL:theURL}
      end tell

I thought maybe there was some weirdness with setting active windows/tabs, and I was somewhat right; this switch fixed the issue.

However, the issue isn’t reproducible anymore. I undid all my changes, and it works perfectly, even in other projects.

If I had to guess, I’d assume that Chrome had some weird internal issue and wasn’t able to comply with that request. I didn’t think to try restarting chrome, but I suspect that may have fixed it as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AppleScript referencing tabs suddently breaking on Chrome
I've been successfully using a script for a long time, which uses Chrome to calculate execute some javascript and return the result. tell ......
Read more >
Executing JavaScript through AppleScript is turned off in ...
This morning all the scripts that use Chrome are getting the following error: WebBrowserActionAllowJavaScriptFromAppl.
Read more >
Applescript "Google Chrome got an error: Can't make |tabs
The error I'm getting is: "Google Chrome got an error: Can't make |tabs| of window id 1 into type specifier." The "offending object"...
Read more >
Javascript executed from Applescript doesn't have access to ...
Issue 543437: Javascript executed from Applescript doesn't have access to the page variables. This issue has been migrated to Launch, see link in...
Read more >
doesn't understand the “open location” message. (-1708 ...
This is an Apple event error: "The script doesn't understand the message. The event was not handled." AppleScript documentation:
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found