Skip to content

fix(template): Add missing configutation for nitro-modules #862

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

serjooo
Copy link

@serjooo serjooo commented Jun 16, 2025

Summary

While creating a nitro-module using npx create-react-native-library@latest and debugging issues I ran to, I noticed there are missing configurations in the podspec.

Mainly the following was missing when building a nitro-module:

  s.source_files = [
    # Implementation (Swift)
    "ios/**/*.{swift}",
    # Autolinking/Registration (Objective-C++)
    "ios/**/*.{m,mm}",
    # Implementation (C++ objects)
    "cpp/**/*.{hpp,cpp}",
  ]

  s.pod_target_xcconfig = {
    # C++ compiler flags, mainly for folly.
    "GCC_PREPROCESSOR_DEFINITIONS" => "$(inherited) FOLLY_NO_CONFIG FOLLY_CFG_NO_COROUTINES"
  }

  s.dependency 'React-jsi'
  s.dependency 'React-callinvoker'

This fixes the compilation errors around not finding Folly, or the module not compiling.

Test plan

I tested this locally by running the tool and having the correct generated file.

@serjooo serjooo changed the title Add missing configutation for nitro-modules fix(template): Add missing configutation for nitro-modules Jun 17, 2025
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.

1 participant