Skip to content

Commit 962b389

Browse files
authored
Merge branch 'main' into idan/load-envs-fix
2 parents 8b0ec8c + 12f0fee commit 962b389

File tree

3 files changed

+28
-9
lines changed

3 files changed

+28
-9
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@
1616
### Fixes
1717

1818
- Vendor `metro/countLines` function to avoid issues with the private import ([#5185](https://github.com/getsentry/sentry-react-native/pull/5185))
19+
- Fix baseJSBundle and bundleToString TypeErrors with Metro 0.83.2 ([#5206](https://github.com/getsentry/sentry-react-native/pull/5206))
20+
21+
### Dependencies
22+
23+
- Bump Cocoa SDK from v8.56.0 to v8.56.1 ([#5197](https://github.com/getsentry/sentry-react-native/pull/5197))
24+
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8561)
25+
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.56.0...8.56.1)
1926

2027
## 7.1.0
2128

packages/core/RNSentry.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Pod::Spec.new do |s|
4646

4747
s.compiler_flags = other_cflags
4848

49-
s.dependency 'Sentry/HybridSDK', '8.56.0'
49+
s.dependency 'Sentry/HybridSDK', '8.56.1'
5050

5151
if defined? install_modules_dependencies
5252
# Default React Native dependencies for 0.71 and above (new and legacy architecture)

packages/core/src/js/tools/vendor/metro/utils.ts

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,19 @@ import type * as sourceMapStringType from 'metro/private/DeltaBundler/Serializer
3131
import type * as bundleToStringType from 'metro/private/lib/bundleToString';
3232
import type { MetroSerializer } from '../../utils';
3333

34-
let baseJSBundle: typeof baseJSBundleType;
34+
let baseJSBundleModule: any;
3535
try {
36-
baseJSBundle = require('metro/private/DeltaBundler/Serializers/baseJSBundle');
37-
} catch (e) {
38-
baseJSBundle = require('metro/src/DeltaBundler/Serializers/baseJSBundle');
36+
baseJSBundleModule = require('metro/private/DeltaBundler/Serializers/baseJSBundle');
37+
} catch {
38+
baseJSBundleModule = require('metro/src/DeltaBundler/Serializers/baseJSBundle');
3939
}
4040

41+
const baseJSBundle: typeof baseJSBundleType =
42+
typeof baseJSBundleModule === 'function'
43+
? baseJSBundleModule
44+
: // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
45+
baseJSBundleModule?.baseJSBundle ?? baseJSBundleModule?.default;
46+
4147
let sourceMapString: typeof sourceMapStringType;
4248
try {
4349
// eslint-disable-next-line @typescript-eslint/no-var-requires
@@ -52,13 +58,19 @@ try {
5258
}
5359
}
5460

55-
let bundleToString: typeof bundleToStringType;
61+
let bundleToStringModule: any;
5662
try {
57-
bundleToString = require('metro/private/lib/bundleToString');
58-
} catch (e) {
59-
bundleToString = require('metro/src/lib/bundleToString');
63+
bundleToStringModule = require('metro/private/lib/bundleToString');
64+
} catch {
65+
bundleToStringModule = require('metro/src/lib/bundleToString');
6066
}
6167

68+
const bundleToString: typeof bundleToStringType =
69+
typeof bundleToStringModule === 'function'
70+
? bundleToStringModule
71+
: // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
72+
bundleToStringModule?.bundleToString ?? bundleToStringModule?.default;
73+
6274
type NewSourceMapStringExport = {
6375
// Since Metro v0.80.10 https://github.com/facebook/metro/compare/v0.80.9...v0.80.10#diff-1b836d1729e527a725305eef0cec22e44605af2700fa413f4c2489ea1a03aebcL28
6476
sourceMapString: typeof sourceMapString;

0 commit comments

Comments
 (0)