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

Conflicting order in css modules causes failed CI #325

Closed
RyanDawkes opened this issue Feb 19, 2024 · 4 comments
Closed

Conflicting order in css modules causes failed CI #325

RyanDawkes opened this issue Feb 19, 2024 · 4 comments

Comments

@RyanDawkes
Copy link

RyanDawkes commented Feb 19, 2024

Description
When trying to run yarn build, Mini CSS throws a warning regarding the order of CSS modules. In a CI process, this causes the run to fail unless process.env.CI is set to false (which is not ideal behaviour).

To Reproduce Steps to reproduce the behavior:

  1. In CLI, run yarn build-web
  2. Inspect build logs to see that Mini CSS is producing a "Conflicting error" warning

Expected behavior
The CSS modules should build without warnings.

Screenshots If applicable, add screenshots to help explain your problem.
image

Additional context Add any other context about the problem here.
I am using GitHub Actions to product my build. Simple workflow script that installs and builds the template

@Gnito
Copy link
Contributor

Gnito commented Feb 19, 2024

Did that happen on a fresh unmodified copy of this template?
We use Circle CI (which sets CI env variable) and the build check does go through.

I've seen this kind of conflict a couple of times when the import order of certain files/modules is not fixed.
This is partly the reason why shared components are imported through components/index.js, since it ensures that those modules are loaded in a specific order.

E.g. have you added Styleguide examples? Those examples might reveal that the CSS imports of child components are not always following the same order, which then throws this warning.

@RyanDawkes
Copy link
Author

I've figured out the issue - I create two new panel components (EditListingAboutPanel and EditListingSpecsPanel), and I had them imported in src/containers/EditListingPage/EditListingWizard/EditListingWizardTab.js as so:

import EditListingAboutPanel from './EditListingAboutPanel/EditListingAboutPanel';
import EditListingAvailabilityPanel from './EditListingAvailabilityPanel/EditListingAvailabilityPanel';
import EditListingDetailsPanel from './EditListingDetailsPanel/EditListingDetailsPanel';
import EditListingDeliveryPanel from './EditListingDeliveryPanel/EditListingDeliveryPanel';
import EditListingLocationPanel from './EditListingLocationPanel/EditListingLocationPanel';
import EditListingPhotosPanel from './EditListingPhotosPanel/EditListingPhotosPanel';
import EditListingPricingPanel from './EditListingPricingPanel/EditListingPricingPanel';
import EditListingPricingAndStockPanel from './EditListingPricingAndStockPanel/EditListingPricingAndStockPanel';
import EditListingSpecsPanel from './EditListingSpecsPanel/EditListingSpecsPanel';

The issue seems to be that I was importing the EditLisingAboutPanel above the other panels. When I moved it down below EditListingPricingAndStockPanel, it fixed the issue

@Gnito
Copy link
Contributor

Gnito commented Feb 21, 2024

This is a pretty good description on how to debug these:
facebook/create-react-app#5372 (comment)

@Gnito
Copy link
Contributor

Gnito commented Feb 26, 2024

Closing this - as the issue seems to be resolved for now.

@Gnito Gnito closed this as completed Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants