next.js - 导出 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,并最终被部署到共享托管服务中。
解决方案
推荐阅读
- wpf - 带有 ItemStyle 和 DataTemplate 的 WPF 样式列表框
- oop - Kotlin setter 打破封装
- python - 在 python 中使用 str.contains 查找两个带有 pandas 的子字符串
- python - Tkinter Canvas:Itemconfig 更新颜色失败
- elasticsearch - 获取在特定字段以前从未见过的日期范围内创建的文档
- c++ - Pre C++17 中模板参数包的“折叠”:惯用方法
- typescript - 上传到 graphql 的文件会自动解析,除非它们在对象内。这是错误还是预期行为?
- html - 响应式设计和网格:我应该把导航栏放在哪里?
- android - 设备可能具有与当前版本不匹配的陈旧 dexed jar(dexopt 错误)
- ios - XCUITest XCUIElementQuery 模态视图中缺少所有非静态文本元素