I'm currently utilizing Django
as the backend and Vue3
as the frontend for my application. While I didn't encounter any issues on the development server, I'm facing problems with page rendering in production. Despite closely following all the documentation available, I can't seem to find a solution.
For rendering the bundle, I'm using django-webpack-loader
combined with webpack5
. However, I've encountered an error that suggests django
might be attempting to render a fallback page.
Refused to execute script from 'https://medtourism.uk/app-a7abdc6b502c1335fd69.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
My webpack.config.js
:
// Your webpack configuration setup goes here
For my typescript config:
{
// Your TypeScript configuration details go here
}
In Django:
WEBPACK_LOADER = {
// Configuration settings for Webpack Loader in Django are provided here
}
Lastly, in my index.html:
{% load render_bundle from webpack_loader %}
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
// HTML head section contents
</head>
<body>
<noscript>
<strong>We apologize, but without JavaScript enabled, the frontend won't function properly. Please enable it to proceed.</strong>
</noscript>
<div id="app"></div>
{% render_bundle 'app' %}
<!-- Auto-injected built files -->
</body>
</html>
If anyone could assist me in resolving this issue, I'd greatly appreciate it.