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.

Cannot assign to read only property 'backgroundColor' of object '#<Object>'

See original GitHub issue

I am trying to style the chart by taking help from the following demo:

https://codesandbox.io/s/2w93lvmqv0?file=/src/index.js:182-1455

But getting error. I am using config property. I am on version 0.4.3 but the demo above provided is on version 0.3.9. I am not sure whether the version update caused something. The error is as follows:

Uncaught TypeError: Cannot assign to read only property 'backgroundColor' of object '#<Object>'

Any kind of help would be much appreciated

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
haZyacommented, Jun 1, 2021

Just put the config object inside the component itself.

0reactions
gyunhwancommented, Jul 13, 2021

I was trying to imitate my superiors. <TimeLine

          config={{
            ...config,
            taskList: {
              title: {
                label: 'work',
                style: {
                  fontSize: '20px',
                  backgroundColor: String('#40a9ff'),
                  borderBottom: 'solid 1px silver',
                  color: 'white',
                  textAlign: 'center',
                },
              },
              verticalSeparator: {
                style: { display: 'none' }, //the style
                grip: {
                  //the four square grip inside the vertical separator
                  style: { visbility: 'hidden' }, //the style to be applied
                },
              },
            },
          }}
        />
Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot assign to read only property 'name' of object '[object ...
Most likely you're using readonly object that can't be edited. Use cloneDeep from lodash.
Read more >
Cannot assign to read only property of Object in JavaScript
The error "Cannot assign to read only property of object" occurs when we try to change a property of an object that has...
Read more >
[Cannot assign to read only property '<field_name>' of object ...
This type of error(Cannot assign to read-only property) generally occurs on update of public property @api decorator variable value.
Read more >
TypeError: "x" is read-only - JavaScript - MDN Web Docs
The JavaScript strict mode-only exception "is read-only" occurs when a global variable or object property that was assigned to is a read-only property....
Read more >
Cannot assign to read only property 'background' of object ...
Uncaught TypeError : Cannot assign to read only property 'background' of object '#<Object>'. my project is babel7. render() { const {elementStyle, style } ......
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