gpt4 book ai didi

html - 登录 MIME 类型 (‘text/html’ ) 不是受支持的样式表 MIME 类型

转载 作者:太空宇宙 更新时间:2023-11-04 07:07:00 26 4
gpt4 key购买 nike

这是我用于 index.html 的代码片段

enter image description here

但是每当我运行这个应用程序时,我都会遇到以下错误

enter image description here

请帮忙

这是我的 .angular-cli.json 文件。这个代码片段可能是一些。我试图弄清楚但不能。\有人可以帮忙吗-

{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "retro-build-con"
},
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": [
"assets",
"favicon.ico"
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "app",
"styles": [
"styles.css"
],
"scripts": [],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"lint": [
{
"project": "src/tsconfig.app.json",
"exclude": "**/node_modules/**"
},
{
"project": "src/tsconfig.spec.json",
"exclude": "**/node_modules/**"
},
{
"project": "e2e/tsconfig.e2e.json",
"exclude": "**/node_modules/**"
}
],
"test": {
"karma": {
"config": "./karma.conf.js"
}
},
"defaults": {
"styleExt": "css",
"component": {}
}
}

最佳答案

看起来您尝试加载的 CSS 文件被重定向到 HTML 页面(可能是由于路由)。

您需要像这样修改 assets block :

  "assets": [
"assets",
"favicon.ico",
"css"
],

这样,CSS 目录将正确地提供它的静态内容

或者,您可以将 CSS 目录移动到 assets 目录,并将路径更改为:

href="assets/css/bootstrap.min.css"

完成更改后,确保再次停止调用 ng serve 以重新启动开发服务器

关于html - 登录 MIME 类型 (‘text/html’ ) 不是受支持的样式表 MIME 类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51526588/

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