Skip to content

fix: resolve codegenNativeComponent parse failure in Expo/Metro bundling#38

Merged
arstiefel merged 1 commit intomainfrom
fix-resolve
Mar 25, 2026
Merged

fix: resolve codegenNativeComponent parse failure in Expo/Metro bundling#38
arstiefel merged 1 commit intomainfrom
fix-resolve

Conversation

@arstiefel
Copy link
Copy Markdown
Collaborator

@arstiefel arstiefel commented Mar 25, 2026

Description

Fixes a Babel transform-time error that caused @react-native/babel-plugin-codegen to throw "Could not find component config for native component" during Metro bundling in Expo projects. The error occurred because Metro was resolving to the compiled lib/module/ files (produced by react-native-builder-bob), which have TypeScript type annotations stripped — but the codegen Babel plugin requires those annotations to generate inline view configs for Fabric components. Adding a react-native condition to the exports map causes Metro to resolve to the TypeScript source files instead, where the NativeProps interfaces are intact.

Also adds react-native.config.js to declare the SDK's native dependency explicitly, including BoltGooglePayButtonComponentDescriptor in the Android componentDescriptors array to ensure correct Fabric
component registration via autolinking.

Testing

  • Created a fresh Expo project, installed the SDK as a local tarball, added imports of ApplePay and GoogleWallet from @boltpay/react-native/payments, and ran expo run:ios and expo run:android — both
    platforms bundled and launched without the "Could not find component config" error.
  • Confirm BoltProvider, ApplePay, and GoogleWallet imports resolve correctly in a consumer project.
  • All 115 existing unit tests pass.

Security Review

Important

A security review is required for every PR in this repository to comply with PCI requirements.

  • I have considered and reviewed security implications of this PR and included the summary below.

Security Impact Summary

No security-sensitive changes. This PR only modifies module resolution configuration (package.json exports map) and autolinking configuration (react-native.config.js). It does not touch authentication, payment flows, user data handling, or external integrations.

@arstiefel arstiefel requested review from a team as code owners March 25, 2026 20:13
@snyk-io
Copy link
Copy Markdown

snyk-io bot commented Mar 25, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@arstiefel arstiefel enabled auto-merge (squash) March 25, 2026 20:15
@arstiefel arstiefel merged commit 14560e9 into main Mar 25, 2026
7 of 9 checks passed
@arstiefel arstiefel deleted the fix-resolve branch March 25, 2026 20:23
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.

2 participants