Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chrome applescript execution error #469

Closed
joshwcomeau opened this issue Aug 22, 2016 · 7 comments
Closed

Chrome applescript execution error #469

joshwcomeau opened this issue Aug 22, 2016 · 7 comments

Comments

@joshwcomeau
Copy link
Contributor

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.

@gaearon
Copy link
Contributor

gaearon commented Aug 22, 2016

I realize I may have voided my warranty by ejecting

What do you mean? Ejecting obviously should work, it’s a first-class feature. 😄

this isn't a high priority issue anyway

If it’s consistently reproducible it is a pretty high priority.
Can you look into why this happens?

@gaearon gaearon added this to the 0.3.0 milestone Aug 22, 2016
@joshwcomeau
Copy link
Contributor Author

joshwcomeau commented Aug 22, 2016

Appreciate that! I kinda assumed that once you eject and start tweaking stuff, support for core functionality becomes much harder to guarantee.

But yeah, to clarify, everything was working fine post-eject until it wasn't; seemingly at random I started experiencing this issue.

I'm totally unfamiliar with applescript / working with OS applications, but I'll poke around and see if I can at least figure out where the problem lies :)

@gaearon
Copy link
Contributor

gaearon commented Aug 22, 2016

Can you reproduce this with master?

@gaearon
Copy link
Contributor

gaearon commented Aug 22, 2016

I think this might be fixed by 44b8313.

@gaearon
Copy link
Contributor

gaearon commented Aug 22, 2016

Can you please try again with react-scripts@0.2.2?

@joshwcomeau
Copy link
Contributor Author

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.

@gaearon gaearon removed this from the 0.3.0 milestone Sep 1, 2016
@gaearon
Copy link
Contributor

gaearon commented 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).

@gaearon gaearon closed this as completed Sep 1, 2016
@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants