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

7.9.1 prevent the use of firestore in React Native #2667

Closed
papay0 opened this issue Feb 24, 2020 · 30 comments · Fixed by #3198, #3240 or #3251
Closed

7.9.1 prevent the use of firestore in React Native #2667

papay0 opened this issue Feb 24, 2020 · 30 comments · Fixed by #3198, #3240 or #3251
Assignees

Comments

@papay0
Copy link

papay0 commented Feb 24, 2020

Hey,

Just quick FYI to tell you that it looks like 7.9.1 is preventing the use of firestore on React Native.
You can find the detail here.

Thanks!

@google-oss-bot
Copy link
Contributor

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

@ImPDP
Copy link

ImPDP commented Feb 24, 2020

@papay0 did you find any solution this problem? the realtime database is working fine but Firestore has some serious issue with the expo. need help

@Edweis
Copy link

Edweis commented Feb 24, 2020

I can confirm, I faced the same issue and downgrading to 7.9.0 solved the issue.

@ImPDP
Copy link

ImPDP commented Feb 24, 2020

@Edweis but downgrading to 7.9.0 doesnt solve my error. the warning is still showing in the console as atob is not found.

@rommelpe
Copy link

Hi y'all, thanks for the inputs. I've tried replicating this issue so I could escalate this to our Firestore folks, but can't seem to replicate it or I might be missing something here. Here's my repro running in the browser with the help of this guide.

If that's not the case, let me know so I can recreate a working repro and be able to reach out to right person.

@schmidt-sebastian
Copy link
Contributor

schmidt-sebastian commented Feb 24, 2020

Sorry to hear this! Since both 7.9.0 and 7.9.1 seem to be broken in different ways, for now I recommend using 7.8.2 with React Native.

@ImPDP
Copy link

ImPDP commented Feb 24, 2020

I have tried this with many lower versions still not working the same error is showing.

@thebrianchen
Copy link

I tried tinkering with @rommelpe's repro, and atob() seems to be defined, so I'm not getting the error. I'm currently investigating the issue, but in the meantime, does following the most-upvoted answer on this stackoverflow post (importing base-64 and adding atob and btoa globals) work as a temporary fix? A recent change in 7.9 started relying on atob, which does not seem to be defined in the global scope in react-native.

Also, if someone could provide a minimal repro with the error, that would be greatly appreciated!

@ImPDP
Copy link

ImPDP commented Feb 25, 2020

Yes. Importing base64 globally in the app.js fixed my problem. Thank you. But many of you suggested downgrading to lower version working. But I had even downgraded to version 6.5.0. It showed the same results only. Anyway, global import seems to be the better solution as of now

@joyner-perez
Copy link

Please do you have an example

@ImPDP
Copy link

ImPDP commented Feb 25, 2020

Check out this question. I have posted my answer.

@carolinemcq
Copy link

carolinemcq commented May 27, 2020

This appears to still be an issue again in 7.14.3, only the workaround posted on StackOverflow no longer works. Is there another way to get around this?

@johnorourke
Copy link

This appears to still be an issue again in 7.14.3, only the workaround posted on StackOverflow no longer works. Is there another way to get around this?

I'm running 7.14.5 on React 16.13.1 and it's OK :)

@carolinemcq
Copy link

This appears to still be an issue again in 7.14.3, only the workaround posted on StackOverflow no longer works. Is there another way to get around this?

I'm running 7.14.5 on React 16.13.1 and it's OK :)

Ok - I'm a total noob at react native so I must be doing something wrong. Can you explain in a bit of detail how you solved this, please?

@johnorourke
Copy link

This appears to still be an issue again in 7.14.3, only the workaround posted on StackOverflow no longer works. Is there another way to get around this?

I'm running 7.14.5 on React 16.13.1 and it's OK :)

Ok - I'm a total noob at react native so I must be doing something wrong. Can you explain in a bit of detail how you solved this, please?

Ignore me, sorry! I didn't read the issue title properly - I am using React web not native!

@schmidt-sebastian
Copy link
Contributor

The workaround posted on StackOverflow worked for me, but it atob and btoa has to be registered before the Firebase SDK is loaded.

@NickFoden
Copy link

Does anyone know if this will be remedied soon or are react-native users planning to stay on version 7.9.0 ?

@schmidt-sebastian
Copy link
Contributor

In review now: #3198

@banjianpan
Copy link

When i go the atob and btoa route, I get this error after about 1 min 7 secs:
103385295_552691125428358_2132763501409926224_n

does anyone know how to fix this? Also I saw that there was a pretty similar issue here: expo/expo#8130 , so these issues might be related!

@luklew
Copy link

luklew commented Jun 19, 2020

Upgraded to 7.15.2,

Getting error when attempting to talk to firestore:

firebase TypeError: util.base64.tI is not a function

This only happens when running on iOS and Android, web works fine.

@schmidt-sebastian
Copy link
Contributor

FYI: The current SDK release is mostly broken for RN. I suggest using 71,5.0 with the atob/bota Polyfill (7.15.2 with Polyfill should also work).

@mirfanahmed
Copy link

I upgraded to version 7.15.3 from 7.15.1 but still I cannot write data on cloud firestore in react native although it is written in the release notes that the problem is fixed. Have anyone tried the latest version?

@joyner-perez
Copy link

yes, it is correct, it throws an error when you try to write

@mirfanahmed
Copy link

yes, it is correct, it throws an error when you try to write

should I downgrade to other version which is working?

@joyner-perez
Copy link

joyner-perez commented Jun 22, 2020

yes, it goes back to 7.9.0.
If you use Expo use this, in your package.json: "firebase": "7.9.0"

@mirfanahmed
Copy link

yes, it goes back to 7.9.0.
If you use Expo use this, in your package.json: "firebase": "7.9.0"

No I am using react native cli..

@joyner-perez
Copy link

in that case I'm not sure which one to go back to

@luklew
Copy link

luklew commented Jun 23, 2020

@JoynerPerez1987
7.14.1 works ok for me

@joyner-perez
Copy link

they just released a new version(7.15.4) and apparently there are still problems.https://firebase.google.com/support/release-notes/js

@schmidt-sebastian
Copy link
Contributor

Re-opening until #3251 lands.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet