Webpack build broken; 'requireNativeComponent' is not exported from 'react-native'
OS:
- [ ] Windows
- [x] MacOS
- [ ] Linux
Platform:
- [ ] iOS
- [ ] Android
- [x] Web
SDK:
- [x]
@sentry/react-native(>= 1.0.0) - [ ]
react-native-sentry(<= 0.43.2)
SDK version: 5.22.2
react-native version: 0.74.1
Are you using Expo?
- [x] Yes
- [ ] No
I have the following issue:
Webpack builds were broken (again) in a recent version, now with the message:
Attempted import error: 'requireNativeComponent' is not exported from 'react-native' (imported as 'requireNativeComponent').
from @sentry/react-native/dist/js/tracing/timetodisplaynative.js.
First reported in https://github.com/getsentry/sentry-react-native/issues/3527#issuecomment-2093216801.
Steps to reproduce:
Run a web build of the @sentry/react-native with Webpack (eg. using the Expo Webpack preset).
Reverting to 5.19.2 resolves the issue.
Actual result:
Attempted import error: 'requireNativeComponent' is not exported from 'react-native' (imported as 'requireNativeComponent').
Expected result:
Builds successfully.