Skip to content

Plotly breaks UI-Kit in SSG and ES6 modules imports #2710

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

Closed
2 tasks done
zettca opened this issue Mar 29, 2022 · 0 comments · Fixed by #2711
Closed
2 tasks done

Plotly breaks UI-Kit in SSG and ES6 modules imports #2710

zettca opened this issue Mar 29, 2022 · 0 comments · Fixed by #2711
Labels
⌛ needs triage Waiting for a review. These issues haven't been looked at yet by a maintainer.

Comments

@zettca
Copy link
Member

zettca commented Mar 29, 2022

Latest version

  • I have tested the latest version

No Hitachi Vantara confidential content

  • I'm not including any Hitachi Vantara confidential content

Current behavior 😯

plotly.js@1 has a bug that prevents:

  • ES6 module loading (breaking modern dev/bundling tools such as vite and snowpack)
  • Server-Side-Rendering because of the way it depends on document (Edit: plotly@2 doesn't really solve this)

As plotly.js@1 is exported (indirectly) in the top-level index.js, it will break as soon as I use any component.

Expected behavior 🤔

Being able to use UI-Kit in modern bundling tools such as vite and SSG frameworks such as remix

Steps to reproduce 🕹

Steps:

  1. Create a Vite app (npm init vite, choose a react template)
  2. Install UI-Kit npm i @hitachivantara/uikit-react-core @material-ui/core plotly.js-basic-dist@1
  3. Import HvProvier in App.tsx
  4. Start dev server: npm run dev
  5. Notice how the app breaks right away

Context 🔦

This error is fixed in plotly.js@2

Your Environment 🌎

Latest MacOS, Chrome, UI-Kit

@zettca zettca added the ⌛ needs triage Waiting for a review. These issues haven't been looked at yet by a maintainer. label Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⌛ needs triage Waiting for a review. These issues haven't been looked at yet by a maintainer.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant