Skip to content

Add --fail-on-error option to host link command #269

Description

@kraenhansen

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.

Activity

  1. added
    enhancementNew feature or request
    Host 🏡Our `react-native-node-api-modules` package
    Linking 🔗Discovering and copying prebuilds from packages into the host
    on Oct 18, 2025
  2. huytdps13400 commented on Aug 23, 2026

    @huytdps13400

    /claim

    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.

  3. huytdps13400 commented on Aug 23, 2026

    @huytdps13400

    Implemented in #453.

    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.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Host 🏡Our `react-native-node-api-modules` packageLinking 🔗Discovering and copying prebuilds from packages into the hostenhancementNew feature or requestgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions