Choroplethmapbox graph does not display equally in Rstudio Graph window and the dash application

Hello, this is my first question, so I will try to be as clear as possible.

I created a plotly Chroplethmapbox graph that actually works when I display in a localhost new window from the Rstudio setup. However, when I use it in a very simple dash code, it does not display well anymore, it just show the layout and the colorbar, but not the counties division fill with the data.

My plotly, dash and R version are updated to the last version.

About the data.
‘pib_total’ is a dataframe where the colums are different years of interest and ‘id’ is the county id.
‘counties’ is the geojson file with an id, features and geometry per county.

The dash app code is the following.

fig <- plot_ly() 
fig <- fig %>% add_trace(
  type="choroplethmapbox",
  geojson=counties,
  locations=pib_total$id,
  z=pib_total$`2019`,
  colorscale="Viridis",
  zmin=0,
  zmax=16000,
  marker=list(line=list(
    width=0),
    opacity=0.5
  )
)
fig <- fig %>% layout(
  mapbox=list(
    style=mapbox_style,
    accesstoken=mapbox_access_token,
    zoom =4.5,
    center=list(lon= -74, lat=6)),
  autosize = TRUE)

app <- Dash$new()
app$layout(
  htmlDiv(
    list(
      dccGraph(figure=fig) 
    )
  )
)

app$run_server(debug=TRUE, dev_tools_hot_reload=FALSE)

Thanks for your help