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.

Error: attempting to change value of a readonly property

See original GitHub issue

Environment:

  • npm: v6.0.0
  • package.json:
      "expo": "^27.0.1",
      "native-base": "^2.7.0",
      "react": "16.3.1",
      "react-native": "~0.55.2",
      "react-native-odoo": "^0.5.0",
      "react-native-side-menu": "^1.1.3",
      "react-native-table-component": "^1.1.8",
      "react-navigation": "^2.6.2",
      "react-navigation-redux-helpers": "^2.0.2",
      "react-redux": "^5.0.7",
      "redux": "^4.0.0",
      "redux-arc": "^0.7.3",
      "redux-thunk": "^2.3.0",
      "rnpm": "^1.9.0",
      "xmldom": "^0.1.27"
    

I’m developing a React Native Expo app. It’ve set the Strict Mode (Expo do it as default).
In this scenario when fsaActionCreatorFactory.js try to execute the following code:

...
  Object.defineProperty(actionCreator, 'name', {
    value: type + ' action creator',
    writable: false
  });
...

the error on the attached image is printed out. ErrorImage.
The property name of the function actionCreator is set as read only. In this way we are trying to force a “set value” and this is forbidden. If I run the app in debug mode (with Strict Mode deactivated) it works fine!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kde3kkocommented, Jul 19, 2018

Yes, I confirm it’s working now. Thanks a lot for the support, and kudos for the awesome work on arc!

1reaction
oraziocontarinocommented, Jul 19, 2018

@kde3kko

edit: How do I deactivate Strict Mode in an Expo project?

I don’t know, i’m a beginner too in Expo and React Apps developments.

@viniciusdacal

Please, let us know if that completely fixed the bug, then we can close the issue 😃

As said in first post, it seems to work (i have commented the function that you have just removed and after a week of development the error has not occurred anymore).

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Attempting to change value of a readonly property ...
I am answering my own question as I found this link which is solving this problem. Set top box is using webkit to...
Read more >
HMR on Android: "TypeError: Attempting to change value of ...
Current Behavior I've followed the HMR setup guide and HMR on Android fails with TypeError: Attempting to change value of readonly property ...
Read more >
Attempted to assign to readonly property` error - Flavio Copes
Strings are immutable in JavaScript. We can't update them once defined. Hence the error. The solution was to, obviously, call JSON.parse() ...
Read more >
TypeError: "x" is read-only - JavaScript - MDN Web Docs
The global variable or object property that was assigned to is a read-only property. (Technically, it is a non-writable data property.) This error...
Read more >
PHP 8.1: Readonly Properties
Read-only property values can only be set from within the class itself, either from the constructor or another method. Once set, no further...
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