christopherdro / christopherdro/react-native-html-to-pdf
Crashes on iOS on old arch
- Dominant language
- Kotlin
- Stars
- 461
- Forks
- 273
- PR merge metrics
- No merged PRs in 30d
Description
### Before submitting a new issue
- [x] I tested using the latest version of the library, as the bug might be already fixed.
- [x] I tested using a [supported version](https://github.com/reactwg/react-native-releases/blob/main/docs/support.md) of react native.
- [x] I checked for possible duplicate issues, with possible answers.
### Bug summary
Crashes on iOS on old arch:
When the line "let file = await generatePDF(options);" runs it crashes with error:
{ [Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'HtmlToPdf' could not be found. Verify that a module by this name is registered in the native binary.] name: 'Invariant Violation', framesToPop: 1 }
I have clean rebuild everything. Still the same error.
I have downgraded back to version 0.12 and it is working as it should as before.
On Android it is working with the latest version also on old arch.
### Library version
1.3.0
### Environment info
```shell
System:
OS: Windows 11 10.0.26100
CPU: "(16) x64 AMD Ryzen 7 5800X 8-Core Processor "
Memory: 25.34 GB / 63.92 GB
Binaries:
Node:
version: 24.8.0
path: C:\Program Files\nodejs\node.EXE
Yarn: Not Found
npm:
version: 11.6.0
path: C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK: Not Found
IDEs:
Android Studio: Not Found
Visual Studio: Not Found
Languages:
Java:
version: 17.0.8.1
path: /cygdrive/c/Program Files/Eclipse Adoptium/jdk-17.0.8.101-hotspot/bin/javac
Ruby: Not Found
npmPackages:
"@react-native-community/cli":
installed: 20.0.0
wanted: 20.0.0
react:
installed: 19.1.0
wanted: 19.1.0
react-native:
installed: 0.81.4
wanted: 0.81.4
react-native-windows: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: Not found
newArchEnabled: Not found
```
### Steps to reproduce
1. Build Pods with old arch = RCT_NEW_ARCH_ENABLED=0 pod install
2. When the line "let file = await generatePDF(options);" runs it crashes with error:
{ [Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'HtmlToPdf' could not be found. Verify that a module by this name is registered in the native binary.] name: 'Invariant Violation', framesToPop: 1 }
### Reproducible example repository
default react-native app
Contributor guide
Research direction
Start by reproducing the crash after installing Pods with RCT_NEW_ARCH_ENABLED=0, then trace the generatePDF(options) call and the HtmlToPdf native-module registration on iOS. Done means the default React Native app can call generatePDF successfully on iOS using the old architecture without the TurboModuleRegistry error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react-native
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100