-
Notifications
You must be signed in to change notification settings - Fork 139
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
Bug: Popcode console is not updating with console.log or errors #2149
Comments
I think tracked it down to these lines in
Haven't figured out the solution yet though :) |
So it looks like we are overwriting our preview support bundles when we update the source |
I wouldn’t expect this to have an effect on the JavaScript environment that’s already loaded onto the page—all we are doing is overwriting the |
But it looks like you weren’t far from the mark: |
This shouldn’t be too difficult to fix in principle—all we have to do is re-add a Might be worth looking into an alternative to JS Channel—JS Channel hasn’t been touched in seven years, I would be surprised if there weren’t other libraries attacking the same problem that might make this easier (although it’s a fairly obscure situation we are in). |
This looks pretty promising as a JS Channel alternative: https://github.com/dollarshaveclub/postmate |
@outoftime happy to take on looking into migrating to postmate. How do you suggest breaking down the PR's given the revert? |
Ehh the more I look into Postmate the less I am convinced it is a particularly good option—the code is a bit goofy and it only works by creating the iframe on the host window side, which is basically a deal-breaker. A few other options come up—Penpal, post-robot, talker.js, and please.js. please.js is out because it has a jQuery dependency. Of the remaining three, talker.js does not seem to be very widely used; penpal and post-robot are probably worth exploring. Anyway, as far as sequencing goes, I would:
Let me know what you think! |
Describe the bug
I think there is an issue with the Popcode console that prevents it from catching any messages from the iframe.
To Reproduce
Two different reproductions:
Type
console.log('hello');
Notice that the browser console contains the message, but Popcode does not
Type
throw new Error('hello');
The Popcode console does not update
@pwjablonski
The text was updated successfully, but these errors were encountered: