Skip to content
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

react-native-web with Webpack warn about TurboModuleRegistry not found #3527

Closed
5 of 12 tasks
jparkrr opened this issue Jan 16, 2024 · 11 comments · Fixed by #3610
Closed
5 of 12 tasks

react-native-web with Webpack warn about TurboModuleRegistry not found #3527

jparkrr opened this issue Jan 16, 2024 · 11 comments · Fixed by #3610
Assignees
Labels
Expo Issues related to Sentry React Native Expo support Platform: React-Native

Comments

@jparkrr
Copy link

jparkrr commented Jan 16, 2024

OS:

  • Windows
  • MacOS
  • Linux

Platform:

  • iOS
  • Android
  • Web

SDK:

  • @sentry/react-native (>= 1.0.0)
  • react-native-sentry (<= 0.43.2)

SDK version: 5.16.0

react-native version: 0.73.2

react-native-web version: 0.18.12

Are you using Expo?

  • Yes
  • No

Are you using sentry.io or on-premise?

  • sentry.io (SaaS)
  • on-premise

I have the following issue:

Getting the following warning with react-native-web. (I'm on expo sdk 50 beta).

WARNING in ./node_modules/@sentry/react-native/dist/js/wrapper.js:33:4
export 'TurboModuleRegistry' (imported as 'TurboModuleRegistry') was not found in 'react-native' (possible exports: AccessibilityInfo, ActivityIndicator, Alert, Animated, AppRegistry, AppState, Appearance, BackHandler, Button, CheckBox, Clipboard, DeviceEventEmitter, DeviceInfo, Dimensions, DrawerLayoutAndroid, Easing, FlatList, I18nManager, Image, ImageBackground, InputAccessoryView, InteractionManager, Keyboard, KeyboardAvoidingView, LayoutAnimation, Linking, LogBox, Modal, NativeEventEmitter, NativeModules, PanResponder, PermissionsAndroid, Picker, PixelRatio, Platform, Pressable, ProgressBar, RefreshControl, SafeAreaView, ScrollView, SectionList, Settings, Share, StatusBar, StyleSheet, Switch, Systrace, TVEventHandler, Text, TextInput, ToastAndroid, Touchable, TouchableHighlight, TouchableNativeFeedback, TouchableOpacity, TouchableWithoutFeedback, UIManager, Vibration, View, ViewPropTypes, VirtualizedList, YellowBox, findNodeHandle, processColor, render, unmountComponentAtNode, unstable_createElement, useColorScheme, useLocaleContext, useWindowDimensions)
  31 |
  32 | const RNSentry: Spec | undefined = isTurboModuleEnabled()
> 33 |   ? TurboModuleRegistry.get<Spec>('RNSentry')
     |    ^
  34 |   : NativeModules.RNSentry;

Everything still seems to work, which is great. Thanks for all your work! But hopefully we can get rid of the warning.

I found a fix for a similar issue with react-native-reanimated: software-mansion/react-native-reanimated#1378

Actual result:

Receive a warning.

Expected result:

No warning

@krystofwoldrich
Copy link
Member

Hi @jparkrr, happy to hear that everything else works,
we will get this fixed.

I just could not reproduce it, what version of the Expo SDK are you using, I have tried it with 50.0.0-preview.8 and built the web using Metro.

@getsantry getsantry bot moved this from Waiting for: Product Owner to Waiting for: Community in GitHub Issues with 👀 2 Jan 17, 2024
@krystofwoldrich krystofwoldrich moved this from Needs Discussion to Needs More Information in Mobile & Cross Platform SDK Jan 17, 2024
@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 2 Jan 17, 2024
@jparkrr
Copy link
Author

jparkrr commented Jan 17, 2024

You're right, I'm using webpack, not metro for web. I know expo has deprecated @expo/webpack-config, but hopefully the warning can be fixed for webpack as well, because there are probably a lot of people using it with react-native-web, both with and without@expo/webpack-config.

Here's a repro for you https://github.com/jparkrr/repro-sentry-warning

Thanks!

@getsantry getsantry bot moved this from Waiting for: Community to Waiting for: Product Owner in GitHub Issues with 👀 2 Jan 17, 2024
@krystofwoldrich
Copy link
Member

Thanks for the confirmation, yes, we can fix the warning for Webpack.

@krystofwoldrich krystofwoldrich moved this from Needs More Information to Needs Discussion in Mobile & Cross Platform SDK Jan 18, 2024
@krystofwoldrich krystofwoldrich changed the title React-native-web warning: TurboModuleRegistry was not found in react-native react-native-web with Webpack warn about TurboModuleRegistry not found Jan 18, 2024
@Niravpatel129
Copy link

just to confirm, i'm also getting a similar issue:

image

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 2 Jan 18, 2024
@krystofwoldrich
Copy link
Member

@Niravpatel129 Thank you.

@sergeushenecz
Copy link

I have also the same warning. i use webpack instead of metro

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 2 Jan 24, 2024
@krystofwoldrich krystofwoldrich added the Expo Issues related to Sentry React Native Expo support label Jan 26, 2024
@krystofwoldrich krystofwoldrich moved this from Needs Discussion to Backlog in Mobile & Cross Platform SDK Jan 26, 2024
@jparkrr
Copy link
Author

jparkrr commented Jan 31, 2024

Any update or workaround on this? We're about to take this into production and it's annoying that all the developers I work with have to see this warning locally every time a fast-refresh happens.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 2 Jan 31, 2024
@krystofwoldrich
Copy link
Member

@jparkrr Thank you for the message, we understand that. We will fix this shortly.

@Joostvd17
Copy link

Hi @krystofwoldrich When do you expect to fix this?

@krystofwoldrich
Copy link
Member

Hi @Joostvd17 Here is the fix

@krystofwoldrich krystofwoldrich self-assigned this Feb 20, 2024
@krystofwoldrich krystofwoldrich moved this from Backlog to Needs Review in Mobile & Cross Platform SDK Feb 20, 2024
@github-project-automation github-project-automation bot moved this from Needs Review to Done in Mobile & Cross Platform SDK Mar 5, 2024
@fb55
Copy link

fb55 commented May 3, 2024

@krystofwoldrich Thanks for the fix! Note that 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. Let me know if you would like to see a new issue for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Expo Issues related to Sentry React Native Expo support Platform: React-Native
Projects
Archived in project
Archived in project
Development

Successfully merging a pull request may close this issue.

6 participants