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.

Uncaught TypeError. Cannot read property 'offsetWidth' of null in PathFindingLinkFactory calculateMatrixDimensions

See original GitHub issue

Getting this error when doing a recalc of the engine with all nodes.

image

stacktrace: PathFindingLinkFactory.tsx:206 Uncaught TypeError: Cannot read property ‘offsetWidth’ of null at PathFindingLinkFactory._this.calculateMatrixDimensions (PathFindingLinkFactory.tsx:206) at PathFindingLinkFactory.calculateCanvasMatrix (PathFindingLinkFactory.tsx:101) at PathFindingLinkFactory.getCanvasMatrix (PathFindingLinkFactory.tsx:96) at PathFindingLinkFactory.calculateRoutingMatrix (PathFindingLinkFactory.tsx:142) at PathFindingLinkFactory.tsx:58 at lodash.js:2750

So it is probably on this line where canvas is null const maxX = Math.max(sumProps(maxXElement, ['x', 'width']), canvas.offsetWidth);

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
Omario-rcommented, Nov 30, 2020

This works for me:

function Diagram() {
  const [engine, setEngine] = useState()

  useEffect(() => {
    const engine = createEngine();
    /*  operations with engine */
    setEngine(engine)
  }, [])

  return (
    <div>
      {engine && <CanvasWidget engine={engine} />}
    </div>
  );
}
1reaction
FavorMylikescommented, Oct 17, 2020

Oh, cool, I’ll try to integrate dagre

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught TypeError: Cannot read property 'offsetWidth' of null
Uncaught TypeError : Cannot read property 'offsetWidth' of null. That is typical error when div id of map container is mismatched with id ......
Read more >
Uncaught TypeError: Cannot read property 'offsetWidth' of null
I am getting this error in my page from spacious: navigation.js:9. subMenu=jQuery(this).next('.sub-menu, .children');if(subMenu.length>0){var ...
Read more >
Cannot read property 'offsetWidth' of null at e.read (uikit.min.js ...
Uncaught TypeError : Cannot read property 'offsetWidth' of null at e.read (uikit.min.js?2.0.5:3). Hi guys,. i'm updating my site from YOO_Katana ...
Read more >
"Cannot read property 'offsetWidth' of null" Error - concrete5
On this page: http://www.fagenpharmacy.com/stores/indiana/demotte/ I'm getting an error that reads "Cannot read property 'offsetWidth' of ...
Read more >
Uncaught TypeError: Cannot read property 'offsetWidth' of null
Calendar list contains events, but events are not displayed on the calendar web part page. Page shows error Uncaught TypeError: Cannot read ......
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