3

I am using Webpack + NPM to build my app and having trouble with Bootstrap-SASS Glyphicons rendering on a production server. Locally the Glyphicons render fine.

In Chrome, I get the following

Failed to decode downloaded font: http://app.azurewebsites.net/build448c34a56d699c29117adc64c43affeb.woff2
OTS parsing error: invalid version tag
Failed to decode downloaded font: http://app.azurewebsites.net/buildfa2772327f55d8198301fdb8bcfc8158.woff
OTS parsing error: invalid version tag
Failed to decode downloaded font: http://app.azurewebsites.net/builde18bbf611f2a2e43afc071aa2f4e1512.ttf
OTS parsing error: invalid version tag

Below are some relevant files. I've looked around but has not been able to find a solution. Please let me know if you have any ideas. Thanks

SCSS File

$icon-font-path: '~bootstrap-sass/assets/fonts/bootstrap/';

@import '~bootstrap-sass/assets/stylesheets/_bootstrap.scss';

Webpack

var path = require('path');
var buildPath = "./build";

var webpack = require('webpack')

module.exports = {
  entry: "./src/entry.js",
  output: {
    path: buildPath,
    publicPath: buildPath,
    filename: "bundle.js"
  },
  module: {
    loaders: [
      {test: /\.css$/, loader: 'style-loader!css'},
      {test: /\.scss$/, loader: 'style-loader!css!sass'},
      // { test: /.woff2?(\?v=\d+.\d+.\d+)?$/, loader: "url?limit=10000&minetype=application/font-woff" },
      {test: /\.(png|jpg|svg|woff|woff2)?(\?v=\d+.\d+.\d+)?$/, loader: 'url-loader?limit=8192'},
      {test: /\.(eot|ttf)$/, loader: 'file-loader'}
    ]
  }
};

NPM

"dependencies": {
    "bootstrap-sass": "^3.3.6",
    "node-sass": "^3.4.2",
    "file-loader": "^0.8.5",
    "css-loader": "^0.21.0",
    "sass-loader": "^3.1.2",
    "style-loader": "^0.13.0",
    "url-loader": "^0.5.7",
    "webpack": "^1.12.2"
}
Pan Wangperawong
  • 1,250
  • 2
  • 13
  • 29

1 Answers1

0

Found a solution. I fixed this issue by specifying an absolute url for the path by doing the following:

output: {
    path: path.resolve(__dirname, "build"),
    publicPath: "build/",
    filename: "bundle.js"
  }
Pan Wangperawong
  • 1,250
  • 2
  • 13
  • 29