Skip to content
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

Color Dependency: Cannot use 'in' operator to search for '0' in rgb #2512

Closed
1 of 3 tasks
akhandsi opened this issue Nov 30, 2022 · 4 comments
Closed
1 of 3 tasks

Color Dependency: Cannot use 'in' operator to search for '0' in rgb #2512

akhandsi opened this issue Nov 30, 2022 · 4 comments
Labels
type: bug 🐛 Something isn't working version: 2 Carbon 11 / v2

Comments

@akhandsi
Copy link

What package(s) are you using?

  • Carbon for IBM Products (or Carbon for IBM Cloud & Cognitive)
  • Legacy/CDAI
  • Legacy/Security

Detailed description

Describe in detail the issue you're having.
While building a hybrid application with both AngularJs and React using webpack 5, "@carbon/ibm-products": "2.0.0-rc.8" causes an issue with transpiling colors/index.js as shown in the screenshot.

Screen Shot 2022-11-29 at 3 39 46 PM

The issue seems to be related to how this library handles esm resolution. https://github.com/Qix-/color/issues?q=.

Is this issue related to a specific component?
Stack trace shows PageHeader.js to originate this issue.

What browser are you working in?
Chrome

What version of the @carbon/ibm-products (or @carbon/ibm-cloud-cognitive)
2.0.0-rc.8

What offering/product do you work on? Any pressing ship or release dates we should be aware of?
This is blocking the upgrade to Carbon V11 for the Turbonomic IBM Product.

  • Notes
    This may be related to how we are bundling and possibly not easy to reproduce on other systems. If that is the case, please let me know and we can get on a call to show our build configurations.
@akhandsi akhandsi added the type: bug 🐛 Something isn't working label Nov 30, 2022
@matthewgallo
Copy link
Member

Hey @akhandsi, can you possibly provide a code sandbox or stack blitz to try to reproduce this error. You can fork this stackblitz we've created for the CreateTearsheet component if that helps.

@elycheea elycheea added the version: 2 Carbon 11 / v2 label Dec 8, 2022
@akhandsi
Copy link
Author

akhandsi commented Dec 8, 2022

@matthewgallo unfortunately the slackblitz that I created did not work. It's mostly how we are bundling our application as commonJS module that could be causing this issue.

Interestingly I did notice that @carbon/themes use color as "color": "^4.0.0" instead of locking to a specific version.

After researching it seems like downgrading colors from 4.2.3 to 4.2.1, fixes this issue. I found this helpful while I researched Esri/calcite-design-system#4481.

Do you see any problem with downgrading?

@akhandsi
Copy link
Author

The Turbonomic UI team downgraded Color to 4.2.1 and this error has gone.

"resolutions": { "color": "4.2.1" },

Feel free to close this issue.

@matthewgallo
Copy link
Member

Ok, that seems like a reasonable solution. I'm noticing now this is stemming from the @carbon/themes package as indicated in your comment from last week, I would open an issue in the main Carbon repo for any further investigation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working version: 2 Carbon 11 / v2
Projects
None yet
Development

No branches or pull requests

3 participants