-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Color dependencies cause initial import to break #5182
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
Comments
Which version of |
1.55.2 |
v1.56.0 is just out. |
Just upgraded and yes the problem persists. |
A couple of questions: |
Having the same issues within a vue app. |
Which plotly.js version you could use without a problem? |
It’s not the plotly version. It’s the version of those color dependencies I mentioned in the original post. They have changed something about their libraries which breaks plotly. |
Could you please tell us more about the error message e.g. line number or other info that could help us debug? |
I can confirm that. Immediatly after the color updates my build broke on the weekend.
With the 1.56 release this broke again. So workaround for now is
|
@dy any idea what the source of the problem is? |
@matthiaskoenig on your repo could you replace |
color-* modules now support native ESM entries, as well as commonjs. That
in some reason causes troubles in plotly browserify pipeline, which is
unexpected. I suspect that is react app webpack config trouble - in some reason that switched to ESM entry and treats it wrong.
Some insight to the problem webpack/webpack#4674
…On Wed, Sep 30, 2020 at 8:49 PM Mojtaba Samimi ***@***.***> wrote:
@matthiaskoenig <https://github.com/matthiaskoenig> on your repo could
you replace plotly.js with plotly.js-dist "v1.56.0" which has no
dependency?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5182 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACJII55CJFWFHD4E2PM643SIPG3HANCNFSM4R7QJA3Q>
.
|
@dy Thanks for the insight. |
@archmoj definitely I can publish fix if you help reproducing the bug, not 100% sure what causes webpack to load mjs instead of cjs, plotly uses |
Ok, I see the problem. Webpack uses What I'd propose - retargeting ...
"main": "dist/plotly.js",
"browser": "dist/plotly.js",
// not supported
// "module": "dist/preact.module.js",
"umd:main": "dist/plotly.js",
"unpkg": "dist/plotly.js",
"source": "lib/index.js",
... |
@archmoj Unfortunately, this is not an option, because I have plotly only as an indirect dependency. |
Same here except I’m using react-plotly.js so that won’t work for me either. I noticed you changed your readMe npm install instructions to the -dist one...is that just a placeholder until this gets sorted out? |
What if in the plotly.js source we simply change |
Though... the color modules reference each other so I guess even if this would fix the reference in the plotly.js source we'd also need to change those internal references. |
I have published color-* packages with "browser" field, that's supposed to take precedence over "module" in webpack. Can you please bump deps and see how it goes - tested in codesandbox, seems to resolve fine. |
@dy Thanks. This fixes the issue with
|
Excellent thank you guys for the quick turnaround on this. Confirmed working. I’m closing the issue. |
Glad this works! But let's let #5189 close it on merge. |
@mtgraves and @matthiaskoenig |
@archmoj I just tested this with plotly.js v1.57.0 and everything works for me. Don't have to pin any dependencies. |
Thanks @matthiaskoenig for testing this out. |
The newest versions of your dependencies color-alpha, color-normalize, color-parse, and color-rgba cause me to not even be able to import plotly into my react apps via:
import Plotly from “plotly.js”;
The error thrown is “Typeerror: rgba is not a function”.
When I roll back to a last known working set of these deps (based on another recent react project) I do not experience this and the plotly library works fine.
Working versions:
color-alpha 1.0.4
color-normalize: 1.5.0
color-parse: 1.3.8
color-rgba: 2.1.1
Newest versions of the above cause initial import issue as described above.
The text was updated successfully, but these errors were encountered: