Skip to content

fix(react-native): stay inert without a native module instead of crashing - #262

Merged
V3RON merged 2 commits into
mainfrom
issue-261-native-module-fatal-release
Oct 15, 2026
Merged

V3RON merged 2 commits into
mainfrom
issue-261-native-module-fatal-release

Conversation

@V3RON

@V3RON V3RON commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Closes #261

What changed

A React Native build that leaves out Appduct's native module no longer crashes when the app registers a tool after startup; the API stays inert as intended. NativeAppduct.ts now looks the module up with TurboModuleRegistry.get, which returns null instead of throwing, so Metro's guardedLoadModule has nothing to report as fatal. resolveNativeModule turns the null into the existing actionable error, outside Metro's guard, where isAppductNativeModuleAvailable catches it. Codegen 0.81.5 accepts get in a spec (@react-native/codegen/lib/parsers/utils.js: name === 'get' || name === 'getEnforcing').

Acceptance criteria

# Criterion Test Tier
1 Without the native module, registerTool after startup does nothing and reports no fatal error under Metro's guarded require missing-native-module-metro.test.ts › registerTool stays inert without reporting a fatal error unit
2 A direct native call still fails with the actionable error, without a fatal error missing-native-module-metro.test.ts › a direct native call still fails with the actionable error unit

E2E evidence

pending

Checklist

  • CHANGELOG.md has an entry under Unreleased (writing-changelog skill), or the change is not user-visible
  • User-facing docs updated for every surface the change touches (writing-user-docs skill), or the change is not user-visible
  • No new import past a module's index.ts; no new direct node:* I/O outside an adapter
  • Simplification checklist from the architecture skill applied, exceptions explained above
  • docs/ARCHITECTURE.md updated if a surface it describes changed

Out of scope

Running the device suite against a Release build without the native module (needs #247).

Status

Implement: done Review: pending E2E: pending Ready: yes

@V3RON
V3RON merged commit 5215954 into main Oct 15, 2026
10 checks passed
@V3RON
V3RON deleted the issue-261-native-module-fatal-release branch October 15, 2026 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

React Native build without the native module crashes on registerTool

1 participant