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

前端 未结 4 1060
遇见更好的自我
遇见更好的自我 2020-12-11 16:05

I have a Vue.js project, when I check the console found this issue bellow:

Refused to apply style from \'http://localhost:8080/dist/cropper.min.css\'

4条回答
  •  南方客
    南方客 (楼主)
    2020-12-11 16:29

    The usual reason for this error message is that when the browser tries to load that resource, the server returns an HTML page instead, for example if your router catches unknown paths and displays a default page without a 404 error. Of course that means the path does not return the expected CSS file / image / icon / whatever.

    To make sure you are in that case, copy the path and try to access it directly in a new browser window or tab. You will see what your server sends.

    The solution is to find the correct path and router configuration so that you get your plain CSS file / image / etc. when accessing that path.

    The exact path and router configuration depends on how you have setup your project and the framework you are using.

提交回复
热议问题