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
{{ message }}
Repository navigation
Add --fail-on-error option to host link command #269
I've come cross this multiple times now, a package doesn't autolink and it's hard to figure out why.
In most cases it turns out to be exports being misconfigured, but this is not apparent since resolvePackageRoot swallows any errors.
Adding a --fail-on-error option to fail and print any errors instead of silently disregarding them would be great.
I reproduced the current behavior with a CLI integration fixture whose dependency has a broken exports target. Default link --android still succeeds and warns, while the new --fail-on-error expectation is red because the option does not exist yet.
I’ll keep the default compatibility behavior, thread the opt-in flag through the link discovery path so the original resolution error is rethrown, and verify the real CLI exit/output plus the host/root test gates.
The new link --fail-on-error mode surfaces the original package-resolution error and exits non-zero, while the default link behavior remains compatible and continues to warn/skip. The CLI integration regression covers both paths with a broken exports fixture.
Verification: focused CLI 4/4, host 63/63, and the full root matrix 109/109; build, lint, Prettier, depcheck, runtime help, and diff checks all pass on Node 24.16.0 / pnpm 10.33.0.
Activity
huytdps13400 commentedon Aug 23, 2026
/claim
I reproduced the current behavior with a CLI integration fixture whose dependency has a broken
exportstarget. Defaultlink --androidstill succeeds and warns, while the new--fail-on-errorexpectation is red because the option does not exist yet.I’ll keep the default compatibility behavior, thread the opt-in flag through the link discovery path so the original resolution error is rethrown, and verify the real CLI exit/output plus the host/root test gates.
huytdps13400 commentedon Aug 23, 2026
Implemented in #453.
The new
link --fail-on-errormode surfaces the original package-resolution error and exits non-zero, while the default link behavior remains compatible and continues to warn/skip. The CLI integration regression covers both paths with a brokenexportsfixture.Verification: focused CLI 4/4, host 63/63, and the full root matrix 109/109; build, lint, Prettier, depcheck, runtime help, and diff checks all pass on Node 24.16.0 / pnpm 10.33.0.