Cannot read property 'offsetWidth' of undefined
See original GitHub issueSerialization doesn’t seem to work with Labels. Easiest repro is to call link1.addLabel('label')
in demos/demo-serializing
https://github.com/projectstorm/react-diagrams/blob/master/packages/diagrams-demo-gallery/demos/demo-serializing/index.tsx#L27-L28
I was able to track down the issue to https://github.com/projectstorm/react-diagrams/blob/master/packages/react-diagrams-core/src/entities/link/LinkWidget.tsx#L106-L114 where LabelWidget
is rendered directly. Should it be using registered Label factory instead?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Getting Cannot read property 'offsetWidth' of undefined with ...
I created a carousel with Bootstrap 3.3 and it works on my local machine, but when I upload the whole thing on server...
Read more >TypeError: Cannot read property 'offsetWidth' of Null in JS
The "Cannot read property 'offsetWidth' of null" error occurs when trying to access the offsetWidth property on a null value. To solve the...
Read more >Cannot read property 'offsetWidth' of undefined when updating ...
Uncaught TypeError : Cannot read property 'offsetWidth' of undefined. The issue is happening even on the demo component when editing a cell:
Read more >Uncaught TypeError: Cannot read property 'offsetWidth' of null
I am using a child theme so I think this is the problem BUT – this isn't the first time a Spacious theme...
Read more >Uncaught TypeError: Cannot read property 'offsetWidth' of ...
Hi everyone! When I tried to use the library, I got this error: Uncaught TypeError: Cannot read property 'offsetWidth' of undefined at new ......
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
@gthx I was facing the same issue, and as a work around, I render the deserialized model after the engine has already been rendered once. It fixed the issue for me.
So in React I load the engine with an empty model and let React render it, then I added a useEffect to load the deserialized data on mount. Then the diagram renders as expected.
Same issue here