且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Node/Express - 拒绝应用样式,因为它的 MIME 类型('text/html')

更新时间:2021-11-08 22:15:52

问题是由不正确命名的文件造成的.我们的学生在 style.css 文件的末尾有一个空格.对此有一些提示,第一个是文本编辑器中缺少语法突出显示,第二个是文本编辑器检测到其他新创建的 css 文件的文件类型,而不是名称不正确的文件.删除空间解决了问题.

The problem is the result of an improperly named file. Our student had a space at the end of the style.css file. There were a few tip offs to this, the first was a lack of syntax highlighting in the text editor, and the second was the text editor detecting the filetype for other newly created css files but not the improperly named file. Removing the space resolved the issue.

感谢 slebetman 为我指明了正确的方向.

Thank you slebetman for your help in pointing me in the right direction.