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.

TypeError: Illegal invocation

See original GitHub issue

Hi. I’m experiencing an issue when using react-easy-state, however the TypeError is coming from this lib so I thought it best to report issue here. This may not be a bug but rather a lack in my understanding of how proxies work or what limitations they may have, or perhaps the issue lies in the Tone.js library classes I’m trying to proxy, in any case here is an example that I think will illustrate the issue better than I can explain:

import React from "react";
import { render } from "react-dom";
import { store, view } from "react-easy-state";
import Tone from "tone";

const osc1 = new Tone.Oscillator();
const osc2 = new Tone.Oscillator();

const proxy = new Proxy(osc1, {
  get(...args) {
    return Reflect.get(...args);
  }
});

// works
console.log(proxy.frequency.value); // => 440

const oscStore = store(osc2);

// throws TypeError: Illegal invovation
const App = view(() => <div>{oscStore.frequency.value}</div>);

render(<App />, document.getElementById("root"));

codesandbox

In the example would expect oscStore to behave exactly like osc2 object or even the proxy object.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
solkimicrebcommented, Mar 8, 2018

I released Observer Util v4.1.2 with a fix for this. It took longer than expected, I was chasing none existent performance issues 😄

Easy State did not get a new version, I let semver do it’s job with transient dependencies. You might need to update your package-lock, if you use any. Let me know if you have issues with the reactivity (it won’t throw illegal invocation errors anymore, but it might not always react as you expect it to - in case of WebAudio built-ins).

Thanks for the issue, closing it now 🙂

0reactions
Lokuacommented, Mar 30, 2018

Just reporting back, so far I am having no issues with reactivity. Thanks again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Uncaught TypeError: Illegal invocation" in Chrome
In your code you are assigning a native method to a property of custom object. When you call support.animationFrame(function () {}) , it...
Read more >
Uncaught TypeError: Illegal invocation - jQuery Forum
Hi, I am getting the above error and can't figure our why? kindly help.. This is my code: var formData = new FormData(); ......
Read more >
Uncaught TypeError: Illegal invocation in Ajax function
I'm trying to send a form to my handler, but I get an error "Uncaught TypeError: Illegal invocation". When I try to send...
Read more >
Debugger: "invoke getter" results in TypeError: Illegal invocation
Debug any web page. While on breakpoint - look through the prototype's children nodes. Click on the "invoke getter" => TypeError: Illegal invocation...
Read more >
TypeError: Illegal invocation - New Relic Explorers Hub
TypeError : Illegal invocation ... Been experiencing a high number of these particular to Windows 10. Not sure how to proceed besides disabling...
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