首页 > 解决方案 > 导出 SSG 时全局样式具有错误的 MIME 类型

问题描述

我曾经next export生成静态 HTML 文件。_next/static/css没有加载任何 CSS 文件。

错误信息

Refused to apply style from 'http://127.0.0.1:5500/_next/static/css/11068a86edb774164743.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
main-c7eb5c9aa267ed608eb4.js:1 

具有全局样式的 CSS 文件和具有模块文件的 CSS 文件会发生错误。

该站点在开发过程中被部署到 GitHub Pages,并最终被部署到共享托管服务中。

标签: next.jsmime-types

解决方案


推荐阅读