-
Notifications
You must be signed in to change notification settings - Fork 213
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
Add Support for React Native for Web (& Expo) #859
Conversation
Hi @waltjones, I'm excited to finally share this with you, and get your feedback. I have tested Android, iOS & Web, and all run successfully with no errors in the consoles. I have also test all platforms forcing an exception, and verified they are tracked correctly to Rollbar dashboard. |
Hi @waltjones, if you could help me, I'm trying to resolve the issues with the CI. The issue that it's getting is fairly trivial stuff that I can fix - however, I cannot understand how to reproduce it locally. I have run
|
@daxfrost It will be a few days before I can take a close look, but I'd suggest confirming you can |
@waltjones thank you so much for getting back to me, I will do whatever I can you suggest until you're available. I did test running Here's the output of me trying on master:
|
@daxfrost Segfault is an odd thing to be seeing here. I'd start with deleting node_modules and |
@waltjones I agree that it's odd, hopefully we can figure this out, here's the output of me doing what you suggested:
|
Hi @waltjones, were you able to test if this issue happens for you? I'd really like to get my local build working even on the |
@daxfrost I've tried again with fresh node_modules, and tests all run fine. Also, there are other people currently working in rollbar.js and theirs (and the build on travis) are working fine. I'm wondering what OS you're on, and maybe we can capture more information about the seg fault. |
Hi! Is there any news on the issues mentioned here? I'm currently trying to use rollbar 2.26.1 in an Expo app and setting the |
Hi @msaarmets , this is handled in rollbar/rollbar-react-native#171 and will release soon. People asked to use the same import for both native and web targets of the same app. This solution provides that. |
Closing in favor of rollbar/rollbar-react-native#171 |
What
This PR introduces React Native for Web support to pure/vanilla (not Expo) React Native projects using Rollbar, and is dependent on another PR for the rollbar-react-native repository.
It's important to understand that Expo & React Native have fundamental differences, Expo is not vanilla React Native, and thus does not support any custom native libraries and cannot use the
rollbar-react-native
package, for this reason the ErrorUtils layer has been moved into this repository (rollbar.js) and can be initialized directly - although theConfiguration
object that resides in the rollbar-react-native repository's./src/Rollbar.js
may be useful to import and use when initializing it from Expo. An issue that is resolved by this PR is mentioned here.The second important difference to understand is that React Native for Web is not compatible with
ErrorUtils
used by native app's JS layer, ErrorUtils is a custom global object ofreact-native
itself, and designed for theJavaScriptCore
headless engine that runs the JS code on Android & iOS devices. React Native for Web, however, runs on any web browser, re-using the code of the consumer's project - it can support ignoring the native libraries, unlike Expo. But it also means that it cannot depend on ErrorUtils for catching global errors, this is catered for in the dependent PR.Changes
JavaScriptCore
supporting React Native layer