fix(ios): avoid WorkletsModule.h import that breaks worklets-enabled builds#1102
Open
Traviskn wants to merge 1 commit into
Open
fix(ios): avoid WorkletsModule.h import that breaks worklets-enabled builds#1102Traviskn wants to merge 1 commit into
Traviskn wants to merge 1 commit into
Conversation
…builds Building an app with react-native-worklets could fail compiling RNAudioAPI with "'rnworklets/rnworklets.h' file not found", because AudioAPIModule.mm imported <worklets/apple/WorkletsModule.h>, which transitively includes the codegen-generated rnworklets spec header that is not visible to the RNAudioAPI compile unit in all build setups (e.g. prebuilt RNWorklets on EAS builds). - Forward-declare the single WorkletsModule method the file actually uses (getWorkletsModuleProxy) instead of importing the full header. - Add ReactCodegen header search paths to the worklets-enabled HEADER_SEARCH_PATHS so generated spec headers remain resolvable. Fixes software-mansion#1095 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
DaveDev42
added a commit
to DaveDev42/teleprompter
that referenced
this pull request
Jun 12, 2026
…t (upstream #1102) (#634) ## What Applies upstream PR software-mansion/react-native-audio-api#1102 (open, unreleased — latest release is our 0.12.2) verbatim as a pnpm patch (`patches/react-native-audio-api.patch`): - **AudioAPIModule.mm**: replace `#import <worklets/apple/WorkletsModule.h>` with a forward-declared `@interface WorkletsModule` exposing the single method used (`getWorkletsModuleProxy`) — removes the transitive dependency on the codegen-generated `<rnworklets/rnworklets.h>` entirely. - **RNAudioAPI.podspec**: add `Headers/Private/ReactCodegen` + `build/generated/ios/ReactCodegen` to HEADER_SEARCH_PATHS in both `pod_target_xcconfig` and `s.xcconfig` (xcconfig-file mechanism — safe, unlike the buildSettings writes that caused #630/#632). ## Why EAS preview build `aed88a0c` (first build after the #633 plugin removal) failed with the ORIGINAL `'rnworklets/rnworklets.h' file not found`. #633 was still correct — the four `audioapi/core/...` errors are gone. The rnworklets error was never fixed by #630, only **masked**: the corrupted builds aborted on the .cpp files before reaching AudioAPIModule.mm. EAS-only root cause: on the EAS builder RNWorklets is **prebuilt**, severing the CocoaPods dependency-header propagation that normally puts `Headers/Public/ReactCodegen` on RNAudioAPI's search paths. Locally RNWorklets builds from source, so it never reproduced here. Upstream's PR comment names this exact scenario. ## Verification (local) - `expo prebuild -p ios --no-install --clean` + `pod install` → RNAudioAPI xcconfig carries the new ReactCodegen paths - `xcodebuild -project Pods/Pods.xcodeproj -target RNAudioAPI -configuration Release -sdk iphoneos` → **BUILD SUCCEEDED**, zero errors, AudioAPIModule.mm compiled with the forward-decl (first-ever local compile of this pod — it landed in #622 after the last local build) ## Cleanup tracking Drop the patch when upstream releases #1102 or equivalent (note added to `.claude/rules/native-build.md`).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1095
Introduced changes
Building an app with react-native-worklets could fail compiling RNAudioAPI with "'rnworklets/rnworklets.h' file not found", because AudioAPIModule.mm imported <worklets/apple/WorkletsModule.h>, which transitively includes the codegen-generated rnworklets spec header that is not visible to the RNAudioAPI compile unit in all build setups (e.g. prebuilt RNWorklets on EAS builds).
Checklist