backlight.dev icon indicating copy to clipboard operation
backlight.dev copied to clipboard

PR Check: Build failing when PostCSS plugin not found

Open kaelig opened this issue 3 years ago • 3 comments

📖 Reproduction steps

  1. In a repository with a PostCSS config file (example below)
  2. 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

kaelig avatar Mar 14 '22 18:03 kaelig

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):

image

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?

bashmish avatar Mar 15 '22 10:03 bashmish

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.

bashmish avatar Mar 15 '22 10:03 bashmish

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

Screen Shot 2022-03-15 at 1 33 24 PM

kaelig avatar Mar 15 '22 20:03 kaelig