我正在进行资产预编译,并以生产模式运行应用程序。 编译后,当我加载我的索引页面时,我在Chrome控制台中收到以下警告:
Failed to decode downloaded font: http://localhost:3000/fonts/ionicons.ttf?v=2.0.0
prospects:1 OTS parsing error: invalid version tag
Failed to decode downloaded font: http://localhost:3000/fonts/ionicons.woff?v=2.0.0
prospects:1 OTS parsing error: invalid version tag
问题是它无法加载图标,而是显示方块。
我们使用了自定义字体,代码如下:
@font-face {
font-family: 'icomoon';
src: font-url('icomoon.eot');
src: font-url('icomoon.eot?#iefix') format('embedded-opentype'),
font-url('icomoon.ttf') format('truetype'),
font-url('icomoon.woff') format('woff'),
font-url('icomoon.svg#icomoon') format('svg');
font-weight: normal;
font-style: normal;
}
我不知道我的那一端缺少什么。我进行了大量搜索,尝试了各种解决方案,但都没有成功。在开发模式下它工作得很好,但不知道为什么在生产模式下会显示正方形。