Skip to content

glyphicons-halflings-regular.woff2 Line 1: Unexpected token ILLEGAL #6

@pdrummond

Description

@pdrummond

When I tried this example, I received the following error:

ERROR in ./~/bootstrap/fonts/glyphicons-halflings-regular.woff2
Module parse failed: /Users/pdrummond/src/bootstrap-webpack-example/node_modules/bootstrap/fonts/glyphicons-halflings-regular.woff2 Line 1: Unexpected token ILLEGAL
You may need an appropriate loader to handle this file type.
(Source code omitted for this binary file)
 @ ./~/bootstrap-webpack/~/css-loader!./~/bootstrap-webpack/~/less-loader!./~/bootstrap-webpack/bootstrap-styles.loader.js!./bootstrap.config.js 2:56882-56943

I am new to webpack so I'm not sure what's happening here but if I add the following to webpack-config.js, the error goes away and it all seems to work as expected:

{ test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&minetype=application/font-woff" },

This is simply a copy of the woff loader entry but for woff2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions