I have an application with CRA with frontend and django backend. I use react-app-rewired to override webpack configuration on frontend so that to save output from webpack-dev-server for django to use.

But I hit the issue as shown in below screenshot. enter image description here

Below is my override-config.js which used to override out-of-box CRA webpack config enter image description here

Weird thing is that there is no such issue for frontend product build(run yarn build and then open localhost:8000 in browser and I can get frontend correctly). Above Refuse to execute ... issue only happen when I run yarn start for development mode.

Here is my package.json enter image description here

And django frontend.html enter image description here

Relative part in django settings.py enter image description here

Thanks in advance for any help!!!

1

There are 1 best solutions below

1
On

Is this only happend in debug mode which is DEBUG = True in Django settings.py? Maybe you would try add assets to urlpatterns

urls.py

if settings.DEBUG:
    urlpatterns += static("/assets/",
                          document_root=settings.FRONTEND_PRODUCTION_DIR) 

reference the document here.