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

[TB] Can't create design system with latest builds #983

Closed
aaronreed708 opened this issue Aug 6, 2024 · 2 comments
Closed

[TB] Can't create design system with latest builds #983

aaronreed708 opened this issue Aug 6, 2024 · 2 comments
Assignees
Labels
bug Something isn't working theme builder app Theme Builder application

Comments

@aaronreed708
Copy link
Contributor

Problem/Concern

For about the last week I've been unable to create a design system with Theme Builder. I keep getting an exception in shades.ts (from a11y-theme-builder-sdk) trying to call chroma.scale, where chroma is imported from chroma-js. The chroma object looks like it holds a path to a .cjs file (chroma.271634d07525ddfb33b4.cjs), not an object with functions, etc on it.

Evan didn't have this problem. But i noticed the failure also on the latest Docker image so not just my environment. i also noticed that the file with that path lives in code/src/ui/build/static/media/chroma.271634d07525ddfb33b4.cjs. In cases where this code works (in docker images built before last week), there is no chroma.xxxx.js file in code/src/ui/build/static/media. Looking at the chroma-js repo, they released a new version, 2.6.0, that my build was picking up. Images that worked didn't have this version, they had v2.4.2. When I forced my package.json to use v2.4.2, the code worked again.

I created issue gka/chroma.js#346 against chroma-js to report the problem. Perhaps the issues is that there isn't a new @types/chroma-js, yet, to accompany the new version of chroma-js?

Proposed Solution

I propose that we should hardcode the path of chroma-js until this issue is resolved.

@aaronreed708 aaronreed708 added bug Something isn't working theme builder app Theme Builder application labels Aug 6, 2024
@aaronreed708 aaronreed708 self-assigned this Aug 6, 2024
aaronreed708 added a commit to finos/a11y-theme-builder-sdk that referenced this issue Aug 6, 2024
aaronreed708 added a commit that referenced this issue Aug 9, 2024
#983: hardcoding version of chroma-js until c…
aaronreed708 added a commit to aaronreed708/a11y-theme-builder that referenced this issue Aug 13, 2024
@aaronreed708
Copy link
Contributor Author

aaronreed708 commented Aug 13, 2024

Heard back from the chroma-js owner. He said that in the latest version, "we refactored chroma.js to ES6 modules and changed the way, the code is imported". When I changed the code to import from the module like they described, this issue still remained.

So I did some more Googling. From what I can tell, we have the problem described here: facebook/create-react-app#12700.

And our issue does not occur if I manually make this change outlined in the PR facebook/create-react-app#12352 in my node_modules/react-scripts/config/webpack.config.js.

I'm going to look at doing this approach: facebook/create-react-app#11889 (comment) since modifying react-scripts is not going to fly :-)

aaronreed708 added a commit that referenced this issue Aug 14, 2024
@aaronreed708
Copy link
Contributor Author

Fixed in commit: 0a1666d. Verified on dev. Closing.

@github-project-automation github-project-automation bot moved this from In Progress to Done in ThemeBuilder Aug 14, 2024
aaronreed708 added a commit to aaronreed708/a11y-theme-builder-sdk that referenced this issue Aug 14, 2024
…moving unused references to chroma-js, updating dependencies to latest levels, correctly importing chroma-js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working theme builder app Theme Builder application
Projects
Status: Done
Development

No branches or pull requests

1 participant