-
Notifications
You must be signed in to change notification settings - Fork 29k
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
JavaScript evaluated by the Notebook renderer is evaluated in the global scope #157076
Comments
@mjbvz I'd like to work on addressing this issue, we can sync up next week or some time tomorrow. |
This bug has been fixed in the latest release of VS Code Insiders! @DonJayamanne, you can help us out by commenting If things still don't seem right, please ensure you're on version 2c80125 of Insiders (today's or later - you can use Happy Coding! |
Does this issue occur when all extensions are disabled?: Yes/No
Steps to Reproduce:
2.Run the following cell twice and have a look at the console output in the renderrers
Basically the error indicates the fact that the const
helloWorld
has already been declared once before.The problem is we're evaluating the JS in the same global scope.
Jupyter doesn't seem to be evaluating them in the global scope.
Here's the problematic code
Not sure if others (extensions) rely on this to run in the global scope, hence I'd suggest adding a metadata for JS mimetypes to ensure the code is evaluated in a private scope, e.g.
isolated
.Jupyter has similar concepts when rendering HTML, https://ipython.org/ipython-doc/3/notebook/nbformat.html#output-metadata
Perhaps we could do the same thing, to ensure the existing functionality stays as is (for the benefit of existing extension authors).
The text was updated successfully, but these errors were encountered: