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
Issue: results.html generated HTML file has multiple issues [1] It has only javascript content, no HTML container tags. [2] The HTML file is so huge that it resolves CDN hosted javascript content instead of referring it.
The E2B code executed:
from dotenv import load_dotenv
load_dotenv()
from e2b_code_interpreter import Sandbox
api_key = E2B_API_KEY
code = "...."
sbx = Sandbox.create(api_key=api_key)
execution = sbx.run_code(code)
In [11]: execution.results
Out[11]: [Result(Formats: html), Result(Formats: html, application/vnd.plotly.v1+json)]
html_content = execution.results[0].html
In [12]: html_content
Out[12]: ' <script type="text/javascript">\n window.PlotlyConfig = {MathJaxConfig: \'local\'};\n if (window.MathJax && window.MathJax.Hub && window.MathJax.Hub.Config) {window.MathJax.Hub.Config({SVG: {font: "STIX-Web"}});}\n </script>\n <script type="module">/**\n* plotly.js v3.0.1\n* Copyright 2012-2025, Plotly, Inc.\n* All rights reserved.\n* Licensed under the MIT license\n*/\n(\n function(root, factory) {\n if (typeof module === "object" && module.exports) {\n module.exports = factory();\n } else {\n root.moduleName = factory();\n }\n} (typeof self !== "undefined" ? self : this, () => {\n"use strict";var Plotly=(()=>{var VQe=Object.create;var MS=Object.defineProperty,HQe=Object.defineProperties,GQe=Object.getOwnPropertyDescriptor,jQe=Object.getOwnPropertyDescriptors,WQ
...
....
The above html_content shows only javascript content, no HTML container tags.
It has resolved and downloaded the entire CDN hosted plotly.js within it.
The expected HTML file should have reference to CDN hosted Plotly.js file
Issue: results.html generated HTML file has multiple issues
[1] It has only javascript content, no HTML container tags.
[2] The HTML file is so huge that it resolves CDN hosted javascript content instead of referring it.
The E2B code executed:
The expected HTML file should have reference to CDN hosted Plotly.js file
References: