You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add PATCHSTACK_SOFT_FAIL so connector errors never break builds
A Lovable publish failed because the project's postbuild script invoked
the CLI with an unrecognized subcommand: the CLI printed usage to stderr
and exited 1, which failed the entire deploy even though the app build
itself succeeded. AI coding tools wire the connector into build scripts,
and they sometimes get the invocation wrong — a security monitor should
degrade gracefully there, not take the site down with it.
PATCHSTACK_SOFT_FAIL (any value except 0/false/no/off) makes the CLI
print the error as before but exit 0, covering both bad usage and
runtime failures (network, config). Manual runs are unaffected unless
the variable is set. The README install prompt now recommends it for
build wiring.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ For how this repo fits with the wider Patchstack ecosystem (`saas`, `hub`, `patc
8
8
9
9
Copy and paste this prompt into any AI coding assistant (Cursor, v0, Bolt, Lovable, Claude Code, etc.):
10
10
11
-
> Add `@patchstack/connect` to this project as a dev dependency, then add `"prebuild": "patchstack-connect scan"` to `package.json``scripts`. The first time the script runs, Patchstack provisions a site automatically from the lockfile and saves the new site UUID to `.patchstackrc.json` — no dashboard signup or manual UUID required. Commit `.patchstackrc.json` so every developer / CI run targets the same site.
11
+
> Add `@patchstack/connect` to this project as a dev dependency, then add `"prebuild": "PATCHSTACK_SOFT_FAIL=1 patchstack-connect scan"` to `package.json``scripts`. Use exactly this command — do not invent other subcommands. The first time the script runs, Patchstack provisions a site automatically from the lockfile and saves the new site UUID to `.patchstackrc.json` — no dashboard signup or manual UUID required. Commit `.patchstackrc.json` so every developer / CI run targets the same site.
> **`PATCHSTACK_SOFT_FAIL=1` keeps a connector problem from breaking your build.** Without it, any connector failure — a network blip, a mistyped subcommand — exits non-zero, and on platforms that run scripts as part of publishing (Lovable, Bolt, CI pipelines) that fails the whole deploy. With it, the connector still prints the error but exits 0. Recommended for any hands-off build; leave it off when running commands manually so you actually see failures.
42
+
41
43
## Quick start (existing site)
42
44
43
45
If you already created an "Application" site in the Patchstack dashboard, pre-seed the UUID:
@@ -78,6 +80,7 @@ Environment variables:
78
80
-`PATCHSTACK_SITE_UUID` — the site UUID from your Patchstack dashboard
79
81
-`PATCHSTACK_ENDPOINT` — override the API endpoint (default `https://api.patchstack.com/monitor/pulse/manifest`)
80
82
-`PATCHSTACK_TIMEOUT_MS` — request timeout in milliseconds (default `30000`)
83
+
-`PATCHSTACK_SOFT_FAIL` — when set (any value except `0`/`false`/`no`/`off`), the CLI prints errors but always exits 0, so a connector problem never fails the build that invokes it
0 commit comments