bug(core): can't define property _: object is not extensible
See original GitHub issueWhat is the current behavior?
- creating the firestore store fails when using the latest
react-native-firebase
(6.0.1
)
What is the expected behavior?
- probably shouldn’t add behavior to the firebase object?
Which version of redux-firestore are you using? What about other dependencies?
"@react-native-firebase/app": "^6.0.1",
"@react-native-firebase/auth": "^6.0.1",
"@react-native-firebase/firestore": "^6.0.1",
"@react-native-firebase/messaging": "^6.0.1",
"@react-native-firebase/storage": "^6.0.1",
"react-redux-firebase": "next",
"redux-firestore": "0.9.0",
Which environments/browsers are affected by this issue? Did this work in previous versions or setups? react native
Minimal demo to reproduce issue (using codesandbox or similar) I will see if I can get to this…
The error I’m seeing is coming from createFirestoreInstance
and seems to be when it assigns the helpers:
firebase._ = merge(defaultInternals, firebase._); // eslint-disable-line no-param-reassign
It looks like rn-firebase has used Object.freeze
(https://github.com/invertase/react-native-firebase/blob/2fed4a9b38935b1973ce05d8e472a51daf3e4e89/packages/app/lib/internal/registry/namespace.js#L251) on the firebase object. Has anyone go this working with rn-firebase 6?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:15 (11 by maintainers)
Top Results From Across the Web
TypeError: can't define property "x": "obj" is not extensible
To fix this error, you will either need to remove the call to Object.preventExtensions() entirely, or move it to a position so that...
Read more >Object is not extensible error when creating new attribute for ...
data when calling the function), but this didn't seem to be a problem as newData is a new copy of data array... I'm...
Read more >TypeError: can't define property "x": "obj" is not extensible
To fix this error, you will either need to remove the call to Object.preventExtensions() entirely, or move it to a position so that...
Read more >JavaScript TypeError - Can't define property "X": "Obj" is not ...
This JavaScript exception can't define property “x”: “obj” is not extensible occurs when Object.preventExtensions() used on an object to ...
Read more >cannot add property ngxs, object is not extensible - You.com
To fix this error, you will either need to remove the call to Object.preventExtensions () entirely, or move it to a position so...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
it works! you saved my day!
in my store config:
export const rrfProps = { firebase: firebase.app(), config: rrfConfig, dispatch: store.dispatch, createFirestoreInstance }
and then<ReactReduxFirebaseProvider {...rrfProps}><App/></ReactReduxFirebaseProvider>
@prescottprue That would be a little cleaner probably - I’m happy to try it the next time in there - probably when looking at fixing the tests for the PR… So, would
firebaseInstance
also befirebase.app()
then? I guess we’d need to look at where extend app puts stuff?