Skip to content
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

[0.76][iOS][Codegen] Fabric Native Component from website has a bug #47175

Open
blakef opened this issue Oct 23, 2024 · 4 comments
Open

[0.76][iOS][Codegen] Fabric Native Component from website has a bug #47175

blakef opened this issue Oct 23, 2024 · 4 comments
Assignees
Labels
Platform: iOS iOS applications. Resolution: PR Submitted A pull request with a fix has been provided.

Comments

@blakef
Copy link
Contributor

blakef commented Oct 23, 2024

Description

Currently codegen generates RCTThirdPartyFabricComponents wrappers with references to the Fabric Components. If these components are inlined in your application, they fail to build (as the they're linked in the Pods and not the App, so can't find the symbols). You'll see an error similar to this (except your component class will be missing):

Undefined symbols for architecture arm64:
  "_CustomWebViewCls", referenced from:
      _RCTThirdPartyFabricComponentsProvider in libReact-RCTFabric.a[41](RCTThirdPartyFabricComponentsProvider.o)
ld: symbol(s) not found for architecture arm64
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

We're expecting a fix to ship in 0.76.1 (#47176), but leaving this issue here as a placeholder until that's the case.

Appendix:

See commented out lines, which you'll have to do until the fix ships.

/*
 * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
 *
 * Do not edit this file as changes may cause incorrect behavior and will be lost
 * once the code is regenerated.
 *
 * @generated by GenerateRCTThirdPartyFabricComponentsProviderH
 */

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wreturn-type-c-linkage"

#import <React/RCTComponentViewProtocol.h>

#ifdef __cplusplus
extern "C" {
#endif

Class<RCTComponentViewProtocol> RCTThirdPartyFabricComponentsProvider(const char *name);
#if RCT_NEW_ARCH_ENABLED
#ifndef RCT_DYNAMIC_FRAMEWORKS

//Class<RCTComponentViewProtocol> CustomWebViewCls(void) __attribute__((used)); // 0

#endif
#endif

#ifdef __cplusplus
}
#endif

#pragma GCC diagnostic pop

and

/**
 * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
 *
 * Do not edit this file as changes may cause incorrect behavior and will be lost
 * once the code is regenerated.
 *
 * @generated by GenerateRCTThirdPartyFabricComponentsProviderCpp
 */

// OSS-compatibility layer

#import "RCTThirdPartyFabricComponentsProvider.h"

#import <string>
#import <unordered_map>

Class<RCTComponentViewProtocol> RCTThirdPartyFabricComponentsProvider(const char *name) {
  static std::unordered_map<std::string, Class (*)(void)> sFabricComponentsClassMap = {
    #if RCT_NEW_ARCH_ENABLED
    #ifndef RCT_DYNAMIC_FRAMEWORKS

//    {"CustomWebView", CustomWebViewCls}, // 0
    #endif
    #endif
  };

  auto p = sFabricComponentsClassMap.find(name);
  if (p != sFabricComponentsClassMap.end()) {
    auto classFunc = p->second;
    return classFunc();
  }
  return nil;
}

Steps to reproduce

N/A

React Native Version

0.76.0

Affected Platforms

Runtime - iOS, Build - MacOS

Output of npx react-native info

N/A

Stacktrace or Logs

N/A

Reproducer

https://github.com/cipolleschi/InAppComponent

Screenshots and Videos

CleanShot 2024-10-23 at 08 59 15@2x

@react-native-bot react-native-bot added Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Platform: iOS iOS applications. labels Oct 23, 2024
@react-native-bot
Copy link
Collaborator

⚠️ Missing Reproducible Example
ℹ️ We could not detect a reproducible example in your issue report. Please provide either:
  • If your bug is UI related: a Snack
  • If your bug is build/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.

@react-native-bot
Copy link
Collaborator

⚠️ Missing Reproducible Example
ℹ️ We could not detect a reproducible example in your issue report. Please provide either:

@shubhamguptadream11
Copy link
Collaborator

@blakef Is this already picked by someone and is being tracked in some PR?

@blakef
Copy link
Contributor Author

blakef commented Oct 23, 2024

Updated to reference the PR: #47176

@blakef blakef self-assigned this Oct 23, 2024
@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Oct 23, 2024
@blakef blakef added Resolution: PR Submitted A pull request with a fix has been provided. and removed Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Needs: Attention Issues where the author has responded to feedback. labels Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: iOS iOS applications. Resolution: PR Submitted A pull request with a fix has been provided.
Projects
None yet
Development

No branches or pull requests

3 participants