Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/webpack/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Fonts Chrome和Firefox无法解析和解码字体_Fonts_Webpack - Fatal编程技术网

Fonts Chrome和Firefox无法解析和解码字体

Fonts Chrome和Firefox无法解析和解码字体,fonts,webpack,Fonts,Webpack,我在后端使用Hapi,在前端使用React。我的网页包配置指定以下内容: module: { loaders: [ { test: /\.(ttf|otf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/, loader: 'file-loader?name=public/ozregular.otf'} ] }, CSS: @font-face { font-family: OzRegular; src: url(/ozregular.otf) for

我在后端使用Hapi,在前端使用React。我的网页包配置指定以下内容:

module: {
  loaders: [
    { test: /\.(ttf|otf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/, loader: 'file-loader?name=public/ozregular.otf'}
  ]
},
CSS:

@font-face {
  font-family: OzRegular;
  src: url(/ozregular.otf) format("opentype");
}
该字体在Safari中可用,但在Chrome中我会遇到以下错误:

在firefox中,我会遇到以下错误:

我尝试了以下问题的答案,但似乎不起作用:

有人知道我如何在Chrome和Firefox中使用这种字体吗