Error: attempting to change value of a readonly property
See original GitHub issueEnvironment:
- 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.
.
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:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top 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 >
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 Free
Top 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
Yes, I confirm it’s working now. Thanks a lot for the support, and kudos for the awesome work on arc!
@kde3kko
I don’t know, i’m a beginner too in Expo and React Apps developments.
@viniciusdacal
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).