backlight.dev
backlight.dev copied to clipboard
PR Check: Build failing when PostCSS plugin not found
📖 Reproduction steps
- In a repository with a PostCSS config file (example below)
- Open a PR
// /.postcssrc.json
{
"plugins": {
"postcss-preset-env": {},
}
}
🙁 Current Behavior
The Backlight PR check shows:
"Failing after 2s — Design system build failed"
As seen in https://github.com/kaelig/kaelig.fr-next/pull/14
The PR Check details show:
Error: Loading PostCSS Plugin failed: Cannot find module 'postcss-preset-env'
Require stack:
/workspace/noop.js
(@/tmp/1l0r0ypst/.postcssrc.json)
🙂 Expected Behavior
Build works.
🔗 Link to the design system
https://backlight.dev/edit/zRlLET1Qkcn3JrnRyWth/design-system
🌐 What browser(s) are you seeing the problem on?
Chrome
Browser version(s)
No response
Tricky one. We don't support a custom PostCSS config (at least not yet). But the error shouldn't happen anyway.
I tried to repro this and see no errors in the PR branch (https://backlight.dev/edit/zRlLET1Qkcn3JrnRyWth/design-system/Button/design/design.link?branch=pr%3A14%40kaelig&p=stories):

I clicked through other pages and there are no errors either. Did you find a workaround? Can you please record a video or give a screenshot if it's still giving this error to you?
Also not sure I fully understand what you mean by the build in this case. It's a PR, I don't think you can make a release build from a PR, for that you need to merge into main first. Therefore I assumed that by build you meant just the regular flow when you load the page and see the result in the right panel.
Also not sure I fully understand what you mean by the build in this case.
In this instance, the word "build" was borrowed from the PR check's status:
build Failing after 2s — Design system build failed