TypeError: Illegal invocation
See original GitHub issueHi. 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"));
In the example would expect oscStore
to behave exactly like osc2
object or even the proxy
object.
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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 🙂
Just reporting back, so far I am having no issues with reactivity. Thanks again.