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.

Warning: `NaN` is an invalid value for the `top` css style property.

See original GitHub issue

Hi there,

I’m getting the following error after adding the first node to the diagram, and proceeding to select it:

Warning: 'NaN' is an invalid value for the 'top' css style property. in div in NodeWidget in div in NodeLayerWidget in div

After inspecting the HTML element in my browser, I can see that the “top” CSS property is not being set for the first node added to the diagram, as it is for subsequent nodes that I add to the diagram:

<div class="node srd-node srd-node--selected " data-nodeid="5070b2af-7155-4072-8738-61d3dbc9b2b0">

I am also unable to move the first node around.

I couldn’t find a bug in my own code that could be causing this, so I wanted to see if this is an issue anyone else has encountered before?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
dacopancommented, Jul 27, 2019

Hi All,

Just to update - this was indeed an error on my part, and related to a bug in the custom Node I created.

Closing this issue.

Thanks

Can you explain what was the bug? I have same error

0reactions
ToTheHitcommented, May 2, 2022

Check your model’s options types. In my case, I set model.setGridSize('15px') but gridSize should be a number and this method returned NaN. https://github.com/projectstorm/react-diagrams/blob/3060496db0709c37202bca948031cd02ebcc73a7/packages/react-canvas-core/src/entities/canvas/CanvasModel.ts#L99-L104

Read more comments on GitHub >

github_iconTop Results From Across the Web

Warning: NaN is an invalid value for the left css style property ...
Test passes ok but generates following error. Warning: `NaN` is an invalid value for the `left` css style property. in div (created by...
Read more >
`NaN` is an invalid value for the `background` css style ...
I changed the value of the background property to a string literal and that fixed the issue. enter={{ background: `${stripe.background}`, }}.
Read more >
`NaN` is an invalid value for the `width` css style property - Web
Everytime I join a meeting, I always get this error in the console, though I can successfully join a meeting, it just bothers...
Read more >
Warning: `NaN` is an invalid value for the `height` css style ...
I'm getting the following warnings in a Jest test: console.error node_modules/fbjs/lib/warning.js:33 Warning: `NaN` is an invalid value for ...
Read more >
React DOM element's style property name or value should not ...
React Warning: NaN is an invalid value for the fontSize css style property. Was this documentation helpful? Analyze Your GitHub Project Now.
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