-
Notifications
You must be signed in to change notification settings - Fork 888
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
@firebase/firestore: Firestore (6.0.4): INTERNAL UNHANDLED ERROR: configureNetworkMonitoring #1824
Comments
Your screenshot does not include the complete error. Please attach the text of the full stack trace from the console. Firestore in Firebase 6.0.4 added support for detecting network status changes in the browser. Until we figure out what the underlying issue is, you can trivially work around this by downgrading to Firebase 6.0.3. Note however, that I don't think react-native even supports Firebase 6 yet. In Firestore's case there were no breaking changes between Firebase 5.x and 6, though there were breaking changes in our dependencies which is why we bumped. On the surface this doesn't seem related, but it could be. The easiest way to get this fixed would be to put together a minimal app that shows the problem. I suspect that there's something up with our platform detection that decided this environment was a browser and tried to apply the new connectivity monitor logic when it actually won't work. However, it's not clear to me that this is the case because it's not entirely clear what you're doing: are you using expo specifically in this case or what? A sample that shows the problem will clear this up. |
@wilhuff thank you for your reply. I will create a sample as soon as I am able to and I will try to downgrade to 6.0.3 or anything under 6. My environment is React Native with Expo SDK 32 (latest at the time of writing). I've got more reports on Reddit from people getting this problem, I will try to inform them about this. I'll tell you when I have a example which doesn't work. |
I had the same problem. This issue may have been introduced by #1808. |
@romain-faust The issue is probably caused by that pull request, and maybe even these lines. Thank you for providing me with this information, I will try to downgrade version by version and see which one works for me. |
Add warning to the installation page to make user experience better, since this guide will make your application crash. Check [this issue](firebase/firebase-js-sdk#1824).
@rauldeheer I believe you are correct. This issue was fixed as part of #1819. As we are already tracking this as part of #1817, I will close this issue. Thanks for reporting this and sorry that we broke your Expo app. |
@schmidt-sebastian Thank you for replying and no problem! |
Same issue here. I've already downgraded to v6.0.2 and v5.11.1 but got the same. |
Hi! The configureNetworkMonitoring code did not exist prior to release 6.0.4, so if you’re still seeing this error, I strongly suspect that your downgrade may not have applied. |
|
@wilhuff I was not able to get anything working above version 6. 5.11.1 worked right away. I cleared cache and did a lot of other things while downgrading. I will try this on a brand new project. |
Saw this cross-linked while trawling through react-native-firebase. I just did a PR to "react-native-clean-project" and if you install that package you'll now have a new react-native command Very useful if you suspect some local state is out of whack while troubleshooting module dependencies. I end up needing it a couple times a week for various reasons This will likely be the recommended react-native way of doing this sort of deep-clean, so it might be useful information |
Same problem here with Expo SDK 32. |
Downgrading to 5.11.1 should solve this, but if it's not, can you try upgrading to 6.1.0? That should also get you back to a working state. Else, can somebody provide a repro project that demonstrates the issue still happening? Thanks. |
Any updates? I am getting same error. |
6.1.0 and 6.1.1 did not work for me, but 5.11.1 did. I was on 6.0.4 previously. @fdeniz Delete node_modules folder, remove firebase references from package.json and package-lock.json, then reinstall with Worked for me. |
@QuintonC Thanks, but it did not help. As a workaround, I set "window" object to "undefined" before calling firestore until this bug fixed, sounds bad but it seems working now.
|
@fdeniz Can you provide the exact error you are getting without that? I think there may be some confusion over what the bug was... The fix in https://github.com/firebase/firebase-js-sdk/pull/1819/files was to make sure that we don't hit the configureNetworkMonitoring() codepath if |
For me the issue occurred once I updated to the newest expo client app today. I checked and Two options for near future I guess: import {Platform} from 'react-native'
// expo-web is inspired or based on react-native-web
// which introduces a 'web' as platform value
if (Platform.OS !== 'web') {
window = undefined
} |
@yannickschuchmann Your solution worked perfectly without having to downgrade from |
@yannickschuchmann Thanks for the added info!
That may be true, but it's also possible we can work around this on the Firebase side if we know exactly what's going wrong. The original report said this was happening in configureNetworkMonitoring() and the only thing we do there is attach two event listeners: https://github.com/firebase/firebase-js-sdk/blob/master/packages/firestore/src/platform_browser/browser_connectivity_monitor.ts#L51 If that is indeed what's failing, maybe we just need to check for the existence of `window.addEventListener. Or if it's failing somewhere else now, we can look at that code instead. So I'm still interested in seeing full error details if somebody can provide them. Thanks! |
@mikelehen Thanks for your help. Full error message on my machine:
@yannickschuchmann Your solution helps to make firestore working but unfortunately causes an error within Expo app on iOS as it tries to create a new instance of window.WebSocket (which is undefined then) in method connectToDevTools. Do you have the same problem? |
@Jncls Thanks very much! @thebrianchen submitted a fix (#1870) so that we should check for |
Same errors for me with Expo and using firebase |
Same here, I have also tried version 6.2.0, did not work ,downgrading to 5.11.1 did. |
We expect this to be fixed in the next JS SDK release. |
This worked for me too. I'm using Expo 33 and didn't need to downgrade. |
Environment:
Problem description:
I'm developing a app with React Native and Expo and it has been in development since earlier this year. I started intergrating Firebase Firestore and Auth in my app right away with this package and I even have a production build in Testflight, meaning that Firebase works perfectly. I never had a problem with Firebase before.
Yesterday I changed some configuration in my app, such as the display name, some email templates and I've added a custom email domain to send emails from. I also upgraded some packages of my application, including Firebase. I've upgraded these versions:
After all these changes I was still able to register and login my app, but as of today my Firestore is crashing all the time. I would like to make it clear that my firebase authentication works fine.
This is the error I'm getting, it may be different sometimes but it is always the Firestore:
Steps to reproduce:
I would love to provide the steps needed to reproduce this problem, but this seems like a strange bug to me so I'm really not sure if/how you can reproduce this issue.
Relevant Code:
Please let me know what code you would like to see. I'm not sure what to post because my application always worked and I did not change any code.
More information:
You can find a post about this on Reddit which I have made here.
The text was updated successfully, but these errors were encountered: