Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Django MIME类型不可执行?_Django_Reactjs_Http_Amazon Elastic Beanstalk_Mime Types - Fatal编程技术网

Django MIME类型不可执行?

Django MIME类型不可执行?,django,reactjs,http,amazon-elastic-beanstalk,mime-types,Django,Reactjs,Http,Amazon Elastic Beanstalk,Mime Types,我构建了一个React+Django应用程序,我使用Elastic Beanstalk在AWS上托管了它。“成功构建”后,在访问环境URL时,我出现以下错误: Refused to execute script from 'http://hihome-app.eba-w5sjpmj3.us-west-2.elasticbeanstalk.com/static/frontend/main.js' because its MIME type ('text/html') is not executab

我构建了一个React+Django应用程序,我使用Elastic Beanstalk在AWS上托管了它。“成功构建”后,在访问环境URL时,我出现以下错误:

Refused to execute script from 'http://hihome-app.eba-w5sjpmj3.us-west-2.elasticbeanstalk.com/static/frontend/main.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
我在互联网上的研究快干涸了。我已经能够收集到弹性豆茎是我的
main.js
?“许多HTTP服务器提供的内容类型头字段值与响应的实际内容不匹配。”(请参阅)因此Elastic Beanstalk不是我的朋友

这里是index.html,main.js就是在这里引入的:

<body>
        <div id="root"></div>
        {% load static %}
        <script src="{% static "frontend/main.js" %}" ></script>
"scripts": {
        "dev": "webpack --mode development --watch ./frontend/src/index.js --output ./frontend/static/frontend/main.js",
        "build": "webpack --mode production ./frontend/src/index.js --output ./frontend/static/frontend/main.js"
    },