You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(Note: might be a duplicate of #44, but that issue doesnt specifically mention the error)
If you create a Generator with Generators.observe or Generator.queue, and that generator updates in the observable runtime, it throws on error on the console. It doesn't effect the value of the cell, the cell still computes just fine, but it seems the Observable runtime is throwing an error for some reason.
The error I get on the console (in Chrome):
worker.327fbbc92318b…8621ada8bfc37b.js:2 Uncaught (in promise) TypeError: i is not a function
at Object.return (worker.327fbbc92318b…8621ada8bfc37b.js:2)
at worker.327fbbc92318b…8621ada8bfc37b.js:2
The text was updated successfully, but these errors were encountered:
asg017
changed the title
Generators.observe and Generator.queue throws a TypeError on the console (side effect
Generators.observe and Generator.queue throws a TypeError on the console (side effect)
Apr 22, 2019
🤔 Indeed, where this is failing is around the dispose method - this return is where it expects either null or a dipose() method, but instead it's getting a Promise. Potentially this is a breakage around async generators.
Not a bug. But could be improved. Generators.observe doesn’t (currently) let you pass in an async initialize function. If you use an async function, your dispose callback will be a promise instead of a function, hence the type error.
Options:
Generators.observe could ignore the return value of initialize if it’s not a function. This seems like it would fail silently and be harder to debug.
Generators.observe could await the promise to invoke the dispose function. This could mean dispose would never be called (as here because the promise is an infinite loop).
Generators.observe could throw an error immediately if initialize returns something that is not a function. This would make the error more obvious.
I vote for the third option. You’d want to rewrite the generator so that it terminated the infinite loop when the generator is disposed, anyway.
(Note: might be a duplicate of #44, but that issue doesnt specifically mention the error)
If you create a Generator with
Generators.observe
orGenerator.queue
, and that generator updates in the observable runtime, it throws on error on the console. It doesn't effect the value of the cell, the cell still computes just fine, but it seems the Observable runtime is throwing an error for some reason.The error I get on the console (in Chrome):
Notebook displaying the error: https://observablehq.com/d/a28ffdc308b73051
The text was updated successfully, but these errors were encountered: