-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
[RN 0.70.0-rc.2] React Native Lottie - function getModule: assertion failed (moduleAsValue.isObject()) #34372
Comments
I've done further testing and it seems like the You mentioned you had a branch working with New Architecture right? Could link it to me? |
Yeah I had a local branch with that. I will try to provide you with something by early next week. I will let you know. |
Any follow-up on this? I'm getting essentially the same issue (but with RN 0.69.4) and am wondering if there's a way forward or if I need to roll back to the old architecture. |
In my case the reason for the So in general, I may assume the mentioned above type of errors has something to do with calling native functions from js. I was able to determine the cause for the crash by using logs from Flipper's Device -> Logs section. Hope that helps someone. |
I had a look into providing a RN69 example but I had to fully recreate that case because I removed the relevant branch already. Unfortunately that new branch is crashing now with the same error mentioned above. The underlying crash is definitely related to something this library integration is doing or generated based on the new arch specs. When removing the package from the example project, I can run the application without issues. |
Hello, I'm getting the same kind of error after upgrading from 0.67.x, happens to me on 0.69, 0.70.rc3-4, and 0.70 stable that recently went out.
I saw in a couple of other threads that the issue is not reproducing on a clean bootstrapped project, unfortunately in my case moving to a new skeleton project is not an option, many configurations and different environments are configured making it not a possible solution. Anyone was able to pinpoint what exactly cause the issue? I've tried comparing all sorts of files in my project with the example project with no success so far |
@AlexanderEggers I am facing the same problem. RN version is 0.70.1 and I have installed iOS pods using new architecture and Fabric. Is there any update related to this issue? |
Please refrain from commenting 'same issue' without providing further context. |
@cortinico I updated the project to the latest stable 0.70.x version and I also moved the project structure to Steps to reproduce:
|
@AlexanderEggers Thanks for doing so. I'll look through it. I experienced the same issues in the past (@cipolleschi as well). The native crash is most likely triggered by a wrong import on the JS side of things. |
It could also be that you are calling a method in JS which is not implemented in Native. |
@cipolleschi I had another look and did a few more changes to introduce typescript for the fabric spec to the project but no change to the issue. I noticed that the actual component is created correctly but as soon as the component communicates with the native layer (via the generated Commands), the crash happens. So yes it would indicate there is somewhere a mismatch but according to the provided generated classes from the CLI there should be no issues. 🤔 In case you want to play around with the latest branch changes:
cc @cortinico |
I tried removing |
I think this issue has to do with how metro is configured on a monorepo/yarn workspaces like this one. I tried linking |
@alfonsocj Thank you so much for looking into this problem from a different angle. Based on your observations, I found the issue which was indeed part of the metro config file. I replaced my config with https://github.com/th3rdwave/react-native-safe-area-context/blob/main/fabric-example/metro.config.js for my fabric example project and seems to be working fine now. I believe that this specific behaviour really needs to be well documented for the new arch - these specific metro config changes were never needed for the old arch. I also got the react-native-lottie library finally compatible with android for fabric 🎉 Just ios is missing but hopefully that won't take as much time. 🤞 |
Wow that's awesome! Thanks for doing that. I had this issue in my inbox but I haven't found the time to look into it. Glad this got solved! |
I hit this assertion failure today in RNTester while working on the move to 0.70.3 for the Apple TV/Android TV fork. I decided to debug it by just commenting out the
|
@cortinico I thought about this some more -- should we consider removing this assertion for debug builds, to allow the real issue to surface in Metro? |
@douglowder I have the same problem and I tried commenting out the I wonder if anyone has any other suggestions or tips? |
Yup @douglowder as @only1chi, removing the Assert is not sufficient. The failure is happening earlier in the execution time and we're not raising it early enough. The |
@cortinico Any idea how I can expose the error since it's happening so early? At the moment, it feels more like guess work. |
Yeah I know the pain. We don't have a solution for this specific instance at this stage, sadly. We're looking into it and hopefully come with a solution in the near future. Any PR is also welcome in this space 🙏 |
@cortinico's comment is as accurate as it is understated! I've spent many hours bisecting this issue, and found it to be caused by any uncaught exception raised by code that runs before the call to In my case, I was importing my package.json (several levels deep in the import chain from index.js) and then dereferencing a non-existent property. After fixing up a lot of similar issues, app runs fine. It's only unfortunate that the assertion makes them quite laborious to find. |
@cortinico I did go through all the node-module packages and updated all the packages that were still using the deprecated The gist of it is that when |
Have you tried looking into the |
@cortinico It may not be as simple as that, as applying the |
@j-piasecki could you elaborate on this? It's the first time we're hearing about this kind of behavior |
@cortinico when you set the Using something like project.pluginManager.withPlugin("com.facebook.react") {
react {
reactNativeDir = rootProject.file("../../../node_modules/react-native/")
codegenDir = rootProject.file("../../../node_modules/react-native-codegen/")
}
} allows to work around this, but requires all modules be on the same level so the paths are correct. |
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
@AlexanderEggers can we close this? |
Oh I missed reporting back around this issue. We got a working preview version with the new arch running for RN Lottie. I believe we can close this issue. Thanks @cortinico |
Description
While testing the latest RC version, I've noticed the following error when starting the application:
Abort message: '/Users/alex/Documents/Projects/lottie-react-native/fabric-example/node_modules/react-native/ReactCommon/react/renderer/uimanager/bindingUtils.cpp:29: function getModule: assertion failed (moduleAsValue.isObject())'
@cortinico - I have provided a more simplified example project in my current WIP branch.
Version
0.70.1
Output of
npx react-native info
System:
OS: macOS 12.5
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 125.38 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.14.2 - /usr/local/bin/node
Yarn: 1.22.18 - ~/.yarn/bin/yarn
npm: 5.1.0 - ~/Documents/Projects/lottie-react-native/node_modules/.bin/npm
Watchman: Not Found
Managers:
CocoaPods: 1.11.3 - /Users/alex/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
Android SDK:
API Levels: 28, 29, 30, 31, 32, 33
Build Tools: 30.0.2, 30.0.3, 31.0.0
System Images: android-29 | Google Play Intel x86 Atom, android-31 | Google Play Intel x86 Atom_64, android-32 | Google APIs Intel x86 Atom_64, android-32 | Google Play Intel x86 Atom_64, android-33 | Google APIs Intel x86 Atom_64, android-33 | Google Play Intel x86 Atom_64
Android NDK: Not Found
IDEs:
Android Studio: 2021.2 AI-212.5712.43.2112.8815526
Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
Languages:
Java: 11.0.16 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.1.0 => 18.1.0
react-native: 0.70.0-rc.2 => 0.70.0-rc.2
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
Steps to reproduce
Snack, code example, screenshot, or link to a repository
https://github.com/AlexanderEggers/lottie-react-native/tree/feature/add-fabric-support
The text was updated successfully, but these errors were encountered: