Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Fix script tag for notebook renderers#5154
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation
emilykl commentedApr 25, 2025
Not my area but I have no objection if this fixes the issue and doesn't break anything else |
marthacryan commentedApr 25, 2025
Also this has been tested by someone who was encountering this issue and it works!#4953 (comment) |
alexcjohnson left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
💃 Makes sense to me.
ab3fbbd intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
This updates the
notebookrenderer to use a plain script tag when embedding all of plotly.js rather than using<script type="module">. Thisfixes#4953. For more context on JS modules, see:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules.Some context:
<script type="module">was added inUse modernnative ES6 importto load plotly.js bundle instead ofrequirejswhich is no longer under active development #4763.<script type="text/javascript">:https://github.com/plotly/plotly.py/blame/26c4443b1a2efc83a5af3efd179c68f5e13cdfad/packages/python/plotly/plotly/io/_base_renderers.py#L292. It seems like usingtype="text/javascript"is no longer necessary since HTML 5:https://stackoverflow.com/questions/25737619/what-is-the-difference-between-script-type-text-javascript-and-script.