Invalid value of type 'builtins.int' received for the 'width' property of layout

Hi

I am trying to change both “width and height” of the plotly plot dynamically by passing these 2 variables value (like 500). But I get ValueError as shown below. I am using Plotly 4.14.3 version. Your help/solution is much appreciated in advance. Thank you.

ERROR
Invalid value of type ‘builtins.int’ received for the ‘width’ property of layout
Received value: 3

The 'width' property is a number and may be specified as:
  - An int or float in the interval [10, inf]

Could you share the code, maybe I could help you.