【问题标题】:reactjs - Refused to apply style from css because its mime type ('text/html') is not supportedreactjs - 拒绝从 css 应用样式,因为它的 mime 类型('text/html')不受支持
【发布时间】:2018-09-03 17:36:25
【问题描述】:

我的 reactjs 项目出现以下错误。我已经展示了我的文件夹结构。

Refused to apply style from 'http://localhost:8093/css/style.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

【问题讨论】:

  • 同意重复的建议。 tldr:在 css 文件中可能除了 css 代码之外还有其他内容(cmets 是最有可能的候选者)。
  • 我看到了那个链接,但这并没有解决我的问题。
  • 如果副本不适用,请发布您的 css 文件内容以供审核。
  • css 文件当前为空。

标签: reactjs


【解决方案1】:

您可以在“index.js”中导入该文件,而不是直接将其添加到“index.html”中, 它会为我工作。Alternative of this problem

【讨论】:

    猜你喜欢
    • 2018-10-24
    • 2020-11-10
    • 1970-01-01
    • 2021-06-04
    • 2018-12-14
    • 1970-01-01
    • 1970-01-01
    • 2021-11-29
    • 2018-12-11
    相关资源
    最近更新 更多