I’m trying to load my dash app through Django, which I’ve done successfully many times up until yesterday where as I updated the script.
I’m not getting any error in the terminal and it works fine on my local machine but when I push it to my server I get this error in the browser console: Uncaught ReferenceError: DashRenderer is not defined
Any idea where I might be going wrong?
Apologies if this has been asked before - looking around it seems people have similar issues but I can’t quite see this one specifically.
A bit more info on the error I’m getting. It comes along side a load of console errors all saying something along the lines of:
Refused to execute script from 'http://127.0.0.1:8000/dataplot/_dash-component-suites/dash_renderer/dash_renderer.v1_2_2m1581339158.min.js' because its MIME type ('application/json') is not executable, and strict MIME type checking is enabled.
The line it gets stuck on while trying to load the page is the following:
<script id="_dash-renderer" type="application/javascript">var renderer = new DashRenderer();</script>
It seems to be from updating various python modules. Unfortunately I updated a load at once and can’t work out which ones might be causing an issue. I’ve tried previous versions of dash and dash-renderer but that doesn’t help.
For those following this, the issue seems to arise from serving up some scripts when loading the page.
I made it work by setting app = Dash(serve_locally = False)
Not sure why I can’t serve things locally but this seems to be a fix for now.