Laravel-mix: Can't use only SASS

Created on 5 Jan 2017  路  6Comments  路  Source: JeffreyWay/laravel-mix

For example, if I want to use only sass mix it will fail:

mix.sass('resources/assets/sass/app.scss', 'public/css/app.css')

Error:

./node_modules/laravel-mix/src/Mix.js:70
        let entry = this.js.reduce((result, paths) => {
                           ^

TypeError: Cannot read property 'reduce' of undefined

If js mix is included , when everything is OK:

mix.js('resources/assets/js/app.js', 'public/js/test.js')
    .sass('resources/assets/sass/app.scss', 'public/css/app.css')

It looks like you must always include js mix

Most helpful comment

Update: I've pushed a new version that will allow you to do mix.sass() without ever calling mix.js(). It'll just create the entry for you.

All 6 comments

@DarkaOnLine Because this uses Webpack, some form of JavaScript bundling is required. - Jeffrey Way

Jup it makes sense :) Webpack can't work without entry...

Are there any plans to make this fail more gracefully? It seems like a harsh way of dealing with an undocumented requirement.

Yeah we might want a better error or documentation about it. Have been getting messages on Twitter about this.

It's both documented and listed in the error output.

"Error: Laravel Mix: You must call "mix.js()" once or more."

Update: I've pushed a new version that will allow you to do mix.sass() without ever calling mix.js(). It'll just create the entry for you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jpriceonline picture jpriceonline  路  3Comments

rlewkowicz picture rlewkowicz  路  3Comments

dtheb picture dtheb  路  3Comments

rderimay picture rderimay  路  3Comments

mementoneli picture mementoneli  路  3Comments