Plotly graph not showing up in rendered html

I made a notebook in VSC with some plotly histograms. They show up in VSC under the cell as expected. However when I convert to html with jupyter nbconvert --to html --no-input main.ipynb and then load the html file in my browser, those graphs don’t show up. There is a missing place where they should be. I can see the div in the inspect window but they’re just blank space. In the console I see

file:///C:/localpath/plotly.js net::ERR_FILE_NOT_FOUND

which is deriving from (among others)

h.load  @   require.min.js:34

The require.min.js is from

I tried manually adding <script src=""></script> to the html file after the title but before the <script src=""></script>.

I can see in my network activity that it downloads that js file but then it still tries to download the local version. I searched the html file and there’s no direct reference to plotly.js so it seems it’s some interaction with that require.js

If I manually download and save it to the same directory as the html file and rename it to plotly.js then it works but I don’t want to have to do that because then it makes sharing the html file extra cumbersome.

How do I get the html file from my notebook to load the remote plotly.js instead of insisting on it coming from a local file at the same relative path?

I needed to change my renderer to notebook_connected

import as pio
pio.renderers.default = "notebook_connected