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
{{ message }}
Repository navigation
[FEATURE]: Allow using v4 bundled types for the browser #7996
It's great that Plotly v4 adds types to the core package. However, the current best way to use Plotly for the browser still seems to be using plotly.js-dist-min since bundling plotly.js fails without Node externs (e.g., Could not resolve "assert"). If I do want to use plotly.js-dist-min though, using the types from the main package is not longer possible (or easy). I need to revert to @types/plotly.js-dist-min, which isn't updated for v4 as of writing.
Why should this feature be added?
Using Plotly in the browser is a fairly common use case. Modern browser apps use build pipelines based on tools like esbuild to bundle and minify their code. Making the experience of this smooth with the built-in types seems useful. This would also allow potentially dropping plotly.js-dist-min and the @types/plotly.js* packages eventually.
Mocks/Designs
n/a
Notes
To reproduce, one can create a simple Angular/React/whatever TypeScript application and add plotly.js as a dependency (and use it somewhere). Trying to run the build will fail. Here's a Stackblitz with Angular:
Thanks for the report! I verified the issue you're describing. I'm inclined to make the plotly.js package more browser friendly, but I also don't see a problem with including the the types in the dist packages. I'll put this on my on deck list.
I opted to include the types in the -dist packages to unblock you for now. There's an existing issue (#6014) that covers dealing with the Node specific functions causing errors, so your other request can be addressed when fixing that one.
Activity
camdecoster commentedon Aug 28, 2026
Thanks for the report! I verified the issue you're describing. I'm inclined to make the plotly.js package more browser friendly, but I also don't see a problem with including the the types in the dist packages. I'll put this on my on deck list.
camdecoster commentedon Aug 31, 2026
I opted to include the types in the -dist packages to unblock you for now. There's an existing issue (#6014) that covers dealing with the Node specific functions causing errors, so your other request can be addressed when fixing that one.