Laravel-mix: font's not found

Created on 7 Feb 2017  路  3Comments  路  Source: JeffreyWay/laravel-mix

Hi, after the update from 0.6.0 to 0.6.3, I got this error:

These dependencies were not found in node_modules:

* ../fonts/MaterialIcons-Regular.eot?v=2.2.1
* ../fonts/MaterialIcons-Regular.woff2?v=2.2.1
* ../fonts/MaterialIcons-Regular.woff?v=2.2.1
* ../fonts/MaterialIcons-Regular.ttf?v=2.2.1
* ../fonts/MaterialIcons-Regular.svg?v=2.2.1

I use "bootstrap-material-icons": "^2.2.0" and include them in my sass file via @import "node_modules/bootstrap-material-icons/scss/material-icons";

Most helpful comment

This error has been fixed by #312, but not tagged yet. Wait for the next release.
馃敤

All 3 comments

Same error. [email protected]

 ERROR  Failed to compile with 11 errors

These dependencies were not found in node_modules:

* ../fonts/fontawesome-webfont.eot?v=4.7.0
* ../fonts/fontawesome-webfont.eot
* ../fonts/fontawesome-webfont.woff2?v=4.7.0
* ../fonts/fontawesome-webfont.woff?v=4.7.0
* ../fonts/fontawesome-webfont.ttf?v=4.7.0
* ../fonts/fontawesome-webfont.svg?v=4.7.0
* ../fonts/bootstrap/glyphicons-halflings-regular.eot
* ../fonts/bootstrap/glyphicons-halflings-regular.woff2
* ../fonts/bootstrap/glyphicons-halflings-regular.woff
* ../fonts/bootstrap/glyphicons-halflings-regular.ttf
* ../fonts/bootstrap/glyphicons-halflings-regular.svg

Did you forget to run npm install --save for them?
> npm -v
4.2.0
> node -v
v6.9.4



md5-f0bbab848ef2f604dff582a1f6cc8fbd



mix.webpackConfig({
    output: {
        publicPath: '/'
    },
    module: {
        rules: [
            {
                test: /\.css$/,
                loaders: ['style-loader', 'css-loader']
            }
        ]
    }
});

mix.copy('resources/assets/images/', 'public/images/', false)
    .copy('node_modules/font-awesome/fonts', 'public/fonts/', false)
    .copy('resources/assets/fonts', 'public/fonts/', false)
    .js('resources/assets/js/app.js', 'public/js/app.js')
    .sass('resources/assets/sass/app.scss', 'public/css')
    .sourceMaps()
    .combine([
        'node_modules/cookieconsent/build/cookieconsent.min.css'
    ], 'public/css/libs.css');

Try with ~bootstrap-material-icons/scss/material-icons to reference a node asset. For Font-Awesome and Glyphicons, override the variable of the font path: $fa-font-path: "~font-awesome/fonts"; and $icon-font-path: "~bootstrap-sass/assets/fonts/bootstrap/";.
Also, you don't need to do mix.copy for fonts and images, as these will be copied to the public directory automatically by Webpack.

This error has been fixed by #312, but not tagged yet. Wait for the next release.
馃敤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rlewkowicz picture rlewkowicz  路  3Comments

hasnatbabur picture hasnatbabur  路  3Comments

sdebacker picture sdebacker  路  3Comments

terion-name picture terion-name  路  3Comments

kpilard picture kpilard  路  3Comments