gpt4 book ai didi

Magento 2 MIME 类型 ('text/html' ) 不可执行,且严格 MIME

转载 作者:行者123 更新时间:2023-12-04 20:27:53 25 4
gpt4 key购买 nike

我是 Magento 2 的新手,我已经对它感到恼火,我进行了全新安装,并且在浏览器设置中一切正常,在前端和后端成功安装后,我遇到错误,我无法登录管理面板,当我加载管理页面给了我这个错误:

Refused to execute script from '<URL>' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

我在网上查了一下,很多评论都说在 pub/static 中缺少 htacess,但一切都很好,我已经清理了缓存、编译、部署等。
我做了这一切,但不明白为什么我仍然收到错误......

enter image description here

前端错误:
enter image description here

注意:我在前端的控制台错误中检查奇怪的是错误行
http://mageuniversity.local/Magento_Theme/js/responsive.js net::ERR_ABORTED 404 (Not Found)

我不明白在“Magento_Theme/js ..”的根路径中到底是怎么看的。

最佳答案

静态文件尚未部署,请尝试

php bin/magento setup:static-content:deploy -f de_DE // or your language code

同时保持开发模式它会显示错误
php bin/magento deploy:mode:set developer

如果您仍然遇到相同的问题,请运行以下命令
rm -rf var  generated pub/static  
mkdir var generated pub/static
chmod 777 -R var generated pub

然后再
php bin/magento setup:static-content:deploy -f
php bin/magento deploy:mode:set developer

关于Magento 2 MIME 类型 ('text/html' ) 不可执行,且严格 MIME,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54431986/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com