Uncaught ReferenceError: DashRenderer is not defined

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.

Thanks!

1 Like

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.

Any help would be much appreciated!

Hello, Could you figure out the issue? I am seeing same error on the Chrome console.

I do not know if this helps you, but I once had this same error and it was due to the requests_pathname_prefix field in my Dash app.

See my question here: Mod_wsgi and dash - virtual host configuration

Unfortunately that doesn’t seem to have helped - thanks for the idea though!

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.

1 Like

Thanks @dig, my app is now working!!..