What is causing "Uncaught ReferenceError: Plotly is not defined"?

Hi,
New to plotly.js and trying to get it working on a WordPress page in a custom form using PHP and JavaScript.
I enqueue the script, and I have conformed it is being loaded when the page loads. I then setup the data and layout for the chart (this part was working on another page on a different site). But the debugger in Firefox shows the message “Uncaught ReferenceError: Plotly is not defined” on the line where the chart is instantiated.

Plotly.newPlot('#myChart', data, layout, config);\n";

I’ve tried loading the plotly js file from the CDN and from the site itself, with no difference in results.

I’m using “/forms/js/plotly-2.29.1.min.js”, and I have confirmed it is being loaded without errors in the debugger.