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

fix(dev): surface PostCSS config errors #7391

Merged
merged 1 commit into from
Sep 11, 2023

Conversation

markdalgleish
Copy link
Member

We were swallowing errors when loading PostCSS config so that it didn't break the build for those without a PostCSS config, but this suppresses real errors for PostCSS consumers when there's a problem with their config.

This PR updates the logic so that we only swallow the missing config error and ensure that all other errors are thrown.

I've also refactored all CSS plugins so that the PostCSS config is loaded lazily rather than up-front in the setup hook. Without this change, consumers see the error coming from the first plugin that happens to be instantiated which is confusing if they're not using the feature, e.g. the error comes from the CSS Modules plugin when they're not using CSS Modules.

@changeset-bot
Copy link

changeset-bot bot commented Sep 11, 2023

🦋 Changeset detected

Latest commit: 0b73c03

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
Name Type
@remix-run/dev Patch
create-remix Patch
remix Patch
@remix-run/architect Patch
@remix-run/cloudflare Patch
@remix-run/cloudflare-pages Patch
@remix-run/cloudflare-workers Patch
@remix-run/css-bundle Patch
@remix-run/deno Patch
@remix-run/eslint-config Patch
@remix-run/express Patch
@remix-run/node Patch
@remix-run/react Patch
@remix-run/serve Patch
@remix-run/server-runtime Patch
@remix-run/testing Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@markdalgleish markdalgleish merged commit 5311c88 into release-next Sep 11, 2023
@markdalgleish markdalgleish deleted the markdalgleish/surface-postcss-errors branch September 11, 2023 20:43
@github-actions
Copy link
Contributor

🤖 Hello there,

We just published version 2.0.0-pre.10 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@github-actions
Copy link
Contributor

🤖 Hello there,

We just published version v0.0.0-nightly-3646f91-20230914 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@github-actions
Copy link
Contributor

🤖 Hello there,

We just published version 2.0.0 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants