Describe the bug
We have an expo project that we are targeting both mobile and web platforms. The react-native-client-sdk works well on mobile but crashes in web.
This is the error I see:
autoEnv.js:24 Uncaught TypeError: Cannot read properties of undefined (reading 'Manufacturer')
which traces to this code in autoEnv, seems like Platform.constants is undefined somehow.
export const ldDevice = {
// key is populated by common/client-sdk
key: '',
envAttributesVersion: '1.0',
manufacturer: Platform.select({
ios: 'apple',
android: Platform.constants.Manufacturer,
}),
model: Platform.select({
// ios: model n/a from PlatformIOSStatic
android: Platform.constants.Model,
}),
os: {
family: Platform.select({
ios: 'apple',
default: Platform.OS,
}),
name: Platform.OS,
version: (_a = Platform.Version) === null || _a === void 0 ? void 0 : _a.toString(),
},
};
To reproduce
Follow the SDK doc to initialize LD client and identify user.
Expected behavior
Expect react-native-client-sdk to work on all platforms expo support (Android, IOS, web)
SDK version
10.1.3
OS/platform
Web browser: Chrome Version 124.0.6367.62
Any insights are greatly appreciated, thank you!