Skip to content

iOS build fails: 'react-native-worklets-core/WKTJsiWorklet.h' file not found #28

@monjodav

Description

@monjodav

Description

iOS build fails with header not found error when using react-native-godot v1.0.1 with react-native-worklets-core v1.6.2.

Error

❌  (node_modules/@borndotcom/react-native-godot/common/NativeGodotModule.cpp:44:10)

  42 | #endif
  43 | 
> 44 | #include <react-native-worklets-core/WKTJsiWorklet.h>
     |          ^ 'react-native-worklets-core/WKTJsiWorklet.h' file not found
  45 | #include <react-native-worklets-core/WKTJsiWorkletContext.h>

Root Cause

The include statement expects headers at <react-native-worklets-core/WKTJsiWorklet.h>, but in react-native-worklets-core v1.6.2, the headers are located at cpp/WKTJsiWorklet.h.

The react-native-worklets-core podspec uses:

s.source_files = "ios/**/*.{h,m,mm}", "cpp/**/*.{h,cpp}"

This doesn't create a header mapping that would expose the headers under react-native-worklets-core/ prefix.

Environment

  • react-native-godot: 1.0.1
  • react-native-worklets-core: 1.6.2
  • react-native: 0.81.5
  • Expo SDK: 54
  • Platform: iOS
  • CocoaPods: 1.16.2

Suggested Fix

Either:

  1. Update the podspec to add proper HEADER_SEARCH_PATHS configuration pointing to $(PODS_ROOT)/../node_modules/react-native-worklets-core/cpp with the include changed to just <WKTJsiWorklet.h>
  2. Or add a dependency declaration with header search path in the podspec:
s.pod_target_xcconfig = {
  "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/../node_modules/react-native-worklets-core\""
}

And create symlinks or adjust include paths accordingly.

Steps to Reproduce

  1. Create a new Expo/React Native project
  2. Install @borndotcom/react-native-godot
  3. Run npx expo run:ios
  4. Build fails with the header not found error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions