Apollo + react-chartjs-2 gives me Uncaught TypeError: Cannot add property _meta, object is not extensible
See original GitHub issueI’m not sure if this is an apollo issue, or a react issue. I keep getting
Uncaught TypeError: Cannot add property _meta, object is not extensible
If I use another way to get the data (aside from apollo), such as a meteor method (http REST call, basically), I can pass the response in to my chart. If I grab the data via apollo, which gets added to the props, I can not pass that object into my chart.
I don’t think it has to do with this:
https://github.com/jerairrest/react-chartjs-2/issues/18
if I pass in an empty object, I don’t get any error. It’s only when I pass in the data via apollo/props
Issue Analytics
- State:
- Created 6 years ago
- Comments:9
Top Results From Across the Web
Apollo + react-chartjs-2 gives me Uncaught TypeError: Cannot ...
I was using the annotation plugin. When I write the annotations property statically it works. But when I fetch the from API it...
Read more >javascript "cannot add property" "object is not extensible ...
apollo client - javascript "cannot add property" "object is not extensible" when I update cache in graphql query - Stack Overflow. Stack ...
Read more >Array from Cache Not Extensible? - Help - Apollo GraphQL
I've got a React useRef that I use to store my appointments when ... Uncaught TypeError: Cannot add property 8, object is not...
Read more >Apollo + react-chartjs-2 gives me Uncaught TypeError: Cannot add ...
I'm not sure if this is an apollo issue, or a react issue. I keep getting. Uncaught TypeError: Cannot add property _meta, object...
Read more >TypeError: invalid assignment to const "x" - JavaScript | MDN
A constant is a value that cannot be altered by the program during normal execution. It cannot change through re-assignment, and it can't...
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
This line creates a copy of the props that can be passed in:
let chartData = JSON.parse(JSON.stringify(data.costData))
Works for now and it updates whenever my apollo query reruns
Clone the props seems to be the short-term workaround.
further reading:
https://stackoverflow.com/questions/41582357/local-copy-of-react-prop-is-read-only