question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug(core): can't define property _: object is not extensible

See original GitHub issue

What 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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:15 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
cristian-mileacommented, Nov 14, 2019

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>

1reaction
bcgilliomcommented, Nov 14, 2019

@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 be firebase.app() then? I guess we’d need to look at where extend app puts stuff?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found