-
Notifications
You must be signed in to change notification settings - Fork 44
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
Run Datadog on Xcode16 with react-native 0.67.5 #733
Comments
Hi @nunoliveira12, We have introduced a polyfill for addressing this issue, but the current conditions for which it applies are not precise, and in some setups like yours the problem still occurs. We will introduce an official fix for this problem. In the meantime, if this is a blocker for you, I believe you could use the following workaround: 1. Install patch-package and big-integer in your project. 2. Configure patch-package by adding this script to your "scripts": {
+ "postinstall": "patch-package"
} 3. Create a folder named 4. Create a file diff --git a/node_modules/@datadog/mobile-react-native/src/polyfills.js b/node_modules/@datadog/mobile-react-native/src/polyfills.js
index 4391fe0..5204098 100644
--- a/node_modules/@datadog/mobile-react-native/src/polyfills.js
+++ b/node_modules/@datadog/mobile-react-native/src/polyfills.js
@@ -4,34 +4,4 @@
* Copyright 2016-Present Datadog, Inc.
*/
-import { version as reactNativeVersion } from 'react-native/package.json';
-
-function applyBigIntPolyfill() {
- const rnVersion = reactNativeVersion.split('.').map(Number);
- const isRn63 = rnVersion[0] === 0 && rnVersion[1] === 63;
-
- if (isRn63 && typeof BigInt === 'undefined') {
- try {
- // eslint-disable-next-line global-require, import/no-extraneous-dependencies
- global.BigInt = require('big-integer');
- console.warn(
- 'React Native 0.63 does not support BigInt, which is required starting from v2.4.0 of Datadog React Native SDK. ' +
- 'The missing type has been polyfilled using `big-integer` to grant back-compatibility. ' +
- 'We strongly suggest updating to a greater version of React Native (>= 0.64).'
- );
- } catch (e) {
- if (e instanceof Error && e.code === 'MODULE_NOT_FOUND') {
- throw new Error(
- 'React Native 0.63 does not support BigInt, which is required starting from v2.4.0 of Datadog React Native SDK. ' +
- 'We strongly suggest updating to a greater version of React Native (>= 0.64).\n\n' +
- 'You can install `big-integer` to enable our polyfill that grants back-compatibility with RN 63:\n\n' +
- '`yarn add big-integer`\n\nOR\n\n`npm install --save big-integer`'
- );
- } else {
- throw e;
- }
- }
- }
-}
-
-applyBigIntPolyfill();
+global.BigInt = require('big-integer');
This should force the polyfill to always be applied, by explicitly and globally defining Let me know if it works for you! I will keep you posted on this matter, and notify you when the release with the fix is out. Does that sound good to you? :) |
Hi @marco-saia-datadog , well, it did fix the problem, but now having the line:
does break every request using fetch:
I believe it is related with this as well and if I comment it it will work. Also, even with that problem commented, I've tried to Archive the app and distribute it for testflight, just to see if it would work, but it does give me an error: I might just downgrade XCode to 15.4, but would be nice to try to fix it |
It would be helpful to see your The second error seems to be unrelated, and actually caused by facebook/hermes#1525. With Xcode 16, Apple has deprecated bitcode for all platforms, meaning that builds with bitcode enabled are no longer accepted. Xcode 16 was released in September 2024, while the RN version you are using is deprecated and was released 2 years ago. You might have to implement a workaround to manually strip the bitcode or, if possible, I suggest upgrading your RN version to a recent |
Yes, I understand it is quite deprecated and probably migrating it to a new version would fix most of it. Either way, it is a somehow complex project using multiple native modules and that's why I'm delaying the migration for that reason. I'll share the package.json to see if it can help on the first error regarding the requests / firstPartyHosts config. Regarding the Xcode16 bitcode, I can see now that it might be a hard battle, better to update asap.
|
Thanks for sharing this patch @marco-saia-datadog 👍🏼 |
Hi! My team encountered this issue as the After 1-2 days of trying to figure out which version of [EDIT: Any versions above So if you're unable to wait for the fix, an suggestion would be to use Thank you once again for the |
Stack trace
ReferenceError: Property 'BigInt' doesn't exist, js engine: hermes
Reproduction steps
Not able to run package version 2.3.6 on Xcode 16 made me install the new version.
After Installing latest version of dd-sdk-reactnative (2.4.4) I have errors of BigInt since I think (?) that RN <0.70 does not support it.
I have the errors as soon as I import anything from Datadog packages.
Volume
100
Affected SDK versions
2.4.4
Latest working SDK version
2.3.6
Does the crash manifest in the latest SDK version?
Yes
React Native Version
0.67.5
Package.json Contents
No response
iOS Setup
No response
Android Setup
No response
Device Information
No response
Other relevant information
No response
The text was updated successfully, but these errors were encountered: