why does semantic-ui-react have circular dependencies, and how do you resolve that when using webpack?

22 views Asked by At

I'm using semantic-ui-react in a create-react-app based React app. I ran into an issue where simply using components like <CardGroup> or <StepGroup> throws a generic, and unfortunately unhelpful, error message: ReferenceError: Cannot access '__WEBPACK_DEFAULT_EXPORT__' before initialization

After banging my head against the wall for several hours, I finally figured out that there are circular dependencies in those components, with <Card> and <Step> respectively.

Then I stumbled upon this old github issue, with this interesting comment. I would love to understand two things here:

  1. What aspect of the design makes this a difficult thing to resolve?
  2. How can/should this work with webpack?
0

There are 0 answers