1

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 Answer 1

0

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. Django DEBUG is always True for both frontend production and development modes. Adding urlpatterns not fix this issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.