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

aeq.extend throwing reflect is read only error, sometimes #58

Open
zlovatt opened this issue Aug 23, 2021 · 1 comment
Open

aeq.extend throwing reflect is read only error, sometimes #58

zlovatt opened this issue Aug 23, 2021 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@zlovatt
Copy link
Member

zlovatt commented Aug 23, 2021

Description:
Certain scripts change the DOM in some way such that aeq.extend throws reflect is read only error.

Steps to reproduce:

  • Run an offending script (specific known examples: lipsyncr v2.7, early versions of Motion, textsyncr v1.6). Unsure whether any are using aeq.
  • Run a script running aeq
  • aeq.extend throws reflect is read only error

Workaround:

  • Restart AE to clear DOM environment
  • launch panels in reverse error, so that aeq tool loads first

The error is on this line specifically: https://github.com/aenhancers/aequery/blob/66f66cfb2a4788175c77797e7a6680da15c2a462/lib/main.js#L173

I'm unsure what these other scripts are changing in the DOM to cause this error; not sure how best to diagnose, either.

Can add a try/catch around this line, but that feels like not the best solution here.

@zlovatt zlovatt added bug Something isn't working help wanted Extra attention is needed labels Aug 23, 2021
@rafikhan
Copy link

A try/catch isn't ideal but you can be selective about it. You can do that for just the reflect error and re-throw if it's something else. That way you aren't swallowing everything. Something similar to this...

try {
   target[name] = copy;
}
catch(e) {
   var isReflectErrorCausedByOtherScriptsMutatingTheDom = (e.message === 'reflect is read only');
   
   if (!isReflectErrorCausedByOtherScriptsMutatingTheDom) {
      // See https://github.com/aenhancers/aequery/issues/58 for context on why this is here.
      throw e;
   }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants