Webpack “OTS parsing error” loading fonts

前端 未结 13 1206
[愿得一人]
[愿得一人] 2020-11-28 20:51

My webpack config specifies that fonts should be loaded using url-loader, and when I try to view the page using Chrome I get the following error:



        
13条回答
  •  爱一瞬间的悲伤
    2020-11-28 21:07

    I know this doesn't answer OPs exact question but I came here with the same symptom but a different cause:

    I had the .scss files of Slick Slider included like this:

    @import "../../../node_modules/slick-carousel/slick/slick.scss";
    

    On closer inspection it turned out that the it was trying to load the font from an invalid location (/assets/css/fonts/slick.woff), the way it was referenced from the stylesheet.

    I ended up simply copying the /font/ to my assets/css/ and the issue was resolved for me.

提交回复
热议问题