-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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 doesn't work with RN 0.22.0 #6566
Comments
I am getting the same error. I realise that I only get this error when I'm invoking: This was working at v0.21 prior to v0.22 upgrade. |
I have checked that |
same here |
@jwngr - any thoughts on this? |
No, but @mikelehen is probably a better person to ask. Could either of you provide a minimal repro? Or is calling |
Commening out |
Anybody have a stacktrace for the error handy by chance? |
@mikelehen Would it be possible for you to set up CI that tests against every commit made to React Native master? That way you could ping us quickly when there's a commit that breaks the Firebase integration, and since we'd have a single commit it should be easy to fix. Alternatively, do you test the React Native RC releases as soon as they come out? |
I have exactly the same error on 0.22 like @phonghho. However, I setup a complete new project with 0.21 as well and the moment i import firebase, it throws the same error. |
I have tested earlier versions of react-native. Surprisingly, the issue doesn't occur on 0.18 and 0.19, but since 0.20 I can repro the issue. |
Possibly related to this Google Groups thread on issues with Firebase not being strict mode compatible... |
This is related to babel-preset-react-native 1.5.3 enabling strict mode. My workaround is:
(restart packager, etc) |
Summary:Since #5422 react-native works with strict mode modules but the transform was not updated since Facebook has some non strict mode compatible internal modules. Now that #5214 has landed and it is easy to change the babel config I think we should enable it by default to make es2015 modules spec compliant. Someone at Facebook will have to make the internal changes necessary to disable strict mode modules for their projects that use non strict mode compatible modules by including a .babelrc file with ``` json { "presets": [ "react-native" ], "plugins": [ ["transform-es2015-modules-commonjs", { "strict": false, "allowTopLevelThis": true }] ] } ``` before merging this. We might also want to mention this in the breaking change section for the next release. Closes #5796 Differential Revision: D3075802 fb-gh-sync-id: e807b67401107e1e944db38453e254025ce0a6c7 shipit-source-id: e807b67401107e1e944db38453e254025ce0a6c7
@keeth Can you create a new issue regarding a custom config not overriding the default one? As mentioned in #6566 (comment) , the correct way to fix this is by adding We should eventually ship a pre-built version of React Native and avoid transforming files under |
@facebook-github-bot answered |
Closing this issue as @satya164 says the question asked has been answered. Please help us by asking questions on StackOverflow. StackOverflow is amazing for Q&A: it has a reputation system, voting, the ability to mark a question as answered. Because of the reputation system it is likely the community will see and answer your question there. This also helps us use the GitHub bug tracker for bugs only. |
You need to run the packager with |
@satya164 I have done that, no dice. I've restarted the packager, deleted all xcode caches, tried putting the ignore in my babelrc under "ignore", tried just ignore of "firebase-web.js" ... running out of ideas |
The |
@jwngr verified all that, barring anything I'm missing. I double checked by putting nonsense in my file and it threw a compilation error in the react packager. The only thing I might be confused by is what happens with doing "bundle" instead of the packager server? I'm bundling the file for embedding into my iOS app. |
@justinr1234 Unfortunately, with the bundler you need to use |
Thanks for the callstack @lneves12! Very helpful. It looks to me like that was a bug in react native fixed by this commit. Can you try updating your react-native dependency to 0.23.0-rc1 which I think has the fix? Thanks! |
This issue seems to be fixed with the version 0.23.0-rc1 👍 Thanks :) |
Great to hear! Thanks for confirming. |
Hey @mikelehen, |
Hey @rsflow, this issue has two different problems being discussed. I'm guessing you're hitting the property 'navigator' of undefined one? Can you try keeth's fix above? #6566 (comment) |
For me the error is still present in 0.23.0-rc1 |
@giacomorebonato Which error? This issue has conflated two separate problems. |
Hey @mikelehen, no I'm getting the |
@rsflow Did you run "npm install" after updating the dependency in your package.json? @giacomorebonato Did you try keeth's fix above? #6566 (comment) |
@mikelehen I changed the file directly on the |
@mikelehen same error after creating babelignore. I am available for more test |
does firebase still not work with RN 0.22.2? |
Works fine with |
@rsflow / @giacomorebonato - Not sure if you guys are still having issues, but this did the trick for me.
|
Hey @gojohnnygo thanks for your help. I did change my |
@gojohnnygo Worked for me, but now my SideMenu component won't work 😢 ... but that's another issue to solve 😄 thanks for your help! |
@facebook-github-bot answered Looks like most of the issues has been resolved. If you encounter similar problem, please try the steps above outlined by the community and in case none of them works for you - let us know to reopen :) |
Ah, it indeed looks like the bot is not working! |
@facebook-github-bot answered |
Should be closed imho. |
Hi, sorry to reopen an old issue but I have the exact same problem.. I tried everything said above but still the same issue... I'm on windows for android, I'm using redux... Here are my dependencies : "dependencies": {
"eslint": "^3.19.0",
"firebase": "^4.1.1",
"lodash": "^4.17.4",
"react": "16.0.0-alpha.6",
"react-native": "^0.44.2",
"react-native-android-back-button": "^0.3.0",
"react-native-barcodescanner": "^3.1.1",
"react-native-material-ui": "^1.11.1",
"react-native-vector-icons": "^4.1.1",
"react-navigation": "^1.0.0-beta.11",
"react-redux": "^5.0.5",
"redux": "^3.6.0",
"redux-thunk": "^2.2.0"
},
"devDependencies": {
"babel-cli": "^6.24.1",
"babel-eslint": "^6.1.2",
"babel-jest": "20.0.3",
"babel-preset-react-native": "1.9.2",
"babel-preset-es2015": "^6.24.1",
"babel-preset-stage-2": "^6.24.1",
"eslint": "^3.19.0",
"eslint-config-airbnb": "^15.0.1",
"eslint-plugin-import": "^2.3.0",
"eslint-plugin-jsx-a11y": "^5.0.3",
"eslint-plugin-react": "^7.0.1",
"eslint-plugin-react-native": "^2.3.2",
"jest": "20.0.4",
"react-test-renderer": "16.0.0-alpha.6",
"remote-redux-devtools": "0.5.0"
}, |
FYI- This issue is a year old, has some 40+ comments on it, and was used to discuss at least 2 completely separate issues. You'll have much better luck opening a new issue with specific repro steps and error details. Feel free to cc me on it so I see it. |
Hello, I am getting
Attempt to invoke virtual method 'java.lang.Object android.util.SparseArray.get(int)' on a null object reference
.Package.json:
"firebase": "^2.4.1", "react": "^0.14.7", "react-native": "^0.22.0"
The text was updated successfully, but these errors were encountered: