Skip to content

Commit 5667fc3

Browse files
Merge pull request #105 from wm-raajvamsy/main
1.9.5 - Fixed Module Headers for RNFB
2 parents 34ff493 + e0126a3 commit 5667fc3

3 files changed

Lines changed: 42 additions & 3 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@wavemaker/wm-reactnative-cli",
3-
"version": "1.9.4",
3+
"version": "1.9.5",
44
"description": "",
55
"main": "index.js",
66
"bin": {

templates/ios-build-patch/podFIlePostInstall.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,45 @@ const newPostInstallBlock =
2626
end
2727
end
2828
end
29+
30+
# Fix for React Native Firebase when using static frameworks
31+
# ROOT CAUSE: Static frameworks with modules enabled create strict module boundaries.
32+
# When RNFBMessaging imports <RNFBApp/...>, the module system expects ALL types to be
33+
# visible through RNFBApp's module exports. But RCTPromiseRejectBlock is in React-Core,
34+
# and RNFBApp doesn't re-export it. The module system blocks access even if headers exist.
35+
#
36+
# SOLUTION: Disable modules for RNFB targets entirely. This makes the compiler use
37+
# traditional #import header inclusion instead of strict module boundaries.
38+
installer.pods_project.targets.each do |target|
39+
if target.name.start_with?('RNFB')
40+
target.build_configurations.each do |config|
41+
# DISABLE modules - this is the key fix
42+
# Without modules, the compiler uses traditional header inclusion and can find
43+
# React-Core types through the header search paths
44+
config.build_settings['CLANG_ENABLE_MODULES'] = 'NO'
45+
46+
# Ensure header maps are enabled so headers can be found
47+
config.build_settings['USE_HEADERMAP'] = 'YES'
48+
49+
# Add React-Core headers to search paths so they can be found via #import
50+
header_search_paths = config.build_settings['HEADER_SEARCH_PATHS'] || '$(inherited)'
51+
react_core_path = File.join(installer.sandbox.root, 'Headers', 'Public', 'React-Core')
52+
react_core_path_quoted = '"' + react_core_path + '"'
53+
if header_search_paths.is_a?(Array)
54+
unless header_search_paths.any? { |path| path.include?('React-Core') }
55+
header_search_paths << react_core_path_quoted
56+
end
57+
elsif header_search_paths.is_a?(String)
58+
unless header_search_paths.include?('React-Core')
59+
config.build_settings['HEADER_SEARCH_PATHS'] = [header_search_paths, react_core_path_quoted]
60+
end
61+
else
62+
config.build_settings['HEADER_SEARCH_PATHS'] = ['$(inherited)', react_core_path_quoted]
63+
end
64+
end
65+
end
66+
end
67+
2968
end`;
3069

3170
module.exports = {

0 commit comments

Comments
 (0)