weixin_39844525
weixin_39844525
2020-12-09 05:22

Roboto-Thin not found in 0.8.0

I just updated the version and this error poped up: Module not found: Can't resolve '../../fonts/roboto/Roboto-Thin.eot' in '...node_modules\roboto-fontface\css\roboto'

该提问来源于开源项目:choffmeister/roboto-fontface-bower

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

6条回答

  • weixin_39984982 weixin_39984982 4月前

    Same issue here with pretty much every font.

    It happens because version 0.8.0 references the wrong path.

    • url in 0.7.1: url('../../fonts/Roboto/Roboto-Thin.eot?#iefix')
    • url in 0.8.0: url('../../fonts/roboto/Roboto-Thin.eot?#iefix')

    The folder is called Roboto with an upper case first letter. In 0.8.0 it searches for the folder with a lower case first letter.

    点赞 评论 复制链接分享
  • weixin_39523625 weixin_39523625 4月前

    Also seeing similar issue with my webpack build:

    ERROR in ./node_modules/css-loader!./node_modules/postcss-loader/lib?{}!./app/web/css/roboto-fontface.css Module not found: Error: Can't resolve 'roboto-fontface/fonts/Roboto/Roboto-Thin.woff2' in '/home/jenkins/workspace/Anywhere Linux Channel/app/web/css' @ ./node_modules/css-loader!./node_modules/postcss-loader/lib?{}!./app/web/css/roboto-fontface.css 6:144-201 6:397-454 @ ./app/web/css/roboto-fontface.css @ ./app/web/js/onboard.js

    Changing the path to a lowercase roboto folder name fixed it.

    点赞 评论 复制链接分享
  • weixin_39984982 weixin_39984982 4月前

    This is a bug for my build, because I copy the fonts directly from node_modules/roboto-fontface during my release scripts. I don't keep my own copy in order to keep up with updates of this package. I'll stick to 0.7.1 for now and hope this gets fixed someday.

    点赞 评论 复制链接分享
  • weixin_39713814 weixin_39713814 4月前

    Looking at what is checked into the source, the folder is correctly in lower cases as referenced in the stylesheets. Please try to remove your node_modules/roboto-fontface/ and then run npm install roboto-fontface.8.0 again. I guess your machine just does not rename the already existing folders.

    点赞 评论 复制链接分享
  • weixin_39984982 weixin_39984982 4月前

    I already tried deleting the whole node_modules folder and running npm install again. It previously didn't make the folder lower case.

    I just tried it again and it seems to have installed it correctly now... weird.

    Issue can be closed then I guess. Maybe the npm-cache folder still had the upper case folder name or something. It's fixed now.

    点赞 评论 复制链接分享
  • weixin_39713814 weixin_39713814 4月前

    Great.

    点赞 评论 复制链接分享