vincej's avatar
Level 15

Error: [webpack-cli] AssertionError [ERR_ASSERTION]: mix.postCss() is missing required parameter 1: src

I have been digging around on the internet and so far have not found a solution. Some posts suggest there has been an upgrade to Mix. It only affects my css. My JS compiles fine. Anyone seen this before?

The require('postcss-custom-properties') was recommended on an SO post, and it appeared to work for some, but not me. https://stackoverflow.com/questions/65935326/assertionerror-err-assertion-mix-postcss-is-missing-required-parameter-1-src

Furthermore, PHPStorm gives an advice on the first line of my css: Argument type string[] is not assignable to parameter type string


mix.js(['resources/js/app.js',
        'resources/js/categories.js',
        'resources/js/create_workorder.js',
        'resources/js/functions.js',
        'resources/js/hashtable.js',
        'resources/js/invoice_additions.js',
        'resources/js/jquery.numberformatter.min.js',
        'resources/js/jquery.tablesorter.min.js',
        'resources/js/orders.js',
        'resources/js/products.js',
        'resources/js/project_quotes.js',
        'resources/js/quotations.js',
        'resources/js/tabs.js',
        'resources/js/validation.js',
        'resources/js/warehouse.js',],
 'public/js/app.js')
    mix.postCss(['resources/css/app.css',						//PHPStorm advice here
            'resources/css/app_override.css',
            'resources/css/bootstrap-theme.css',
            'resources/css/bootstrap_override.css',
            'resources/css/default.css',
            'resources/css/help.css',
            'resources/css/jqueryui.css',
            'resources/css/mobile.css',
            'resources/css/favicon.png'],
        'public/css',[
            require('postcss-custom-properties')
            ])
    .sourceMaps();


0 likes
8 replies
jlrdw's avatar

Are there issues if you try the second way in documentation:

Or, you may execute postCss with no additional plugins in order to achieve simple CSS compilation and minification:

mix.postCss('resources/css/app.css', 'public/css');

https://laravel.com/docs/9.x/mix#postcss

vincej's avatar
Level 15

I did install , npm install postcss-custom-properties --save-dev

I will remove that

vincej's avatar
Level 15

@jlrdw I can't get this thing to work. Stupid thing is it works on my other projects. would it be a better idea for me import ( or require ?) all my JS functions into app.js and then only have app.js in mix?

vincej's avatar
Level 15

Many Thanks for that ! Unfortunately, I missed your post, and ended up painfully individually writing all the css files out like this: .css("resources/css/app.css", "public/css") Ugh. But it works now!

an entire different question. I think you are a raw JS / JQuery person. However, if you have ever looked at Vue, please tell me whether you think it is useful. Cheers !

vincej's avatar
Level 15

Yes, thanks, I have looked at that series, in addition to a couple of others on youtube. So far I have exclusively used JS & JQuery, however, I have been playing with Vue and inertia. I find manipulating the DOM boring and painful, especially in complex tables and forms. I have not made the leap and am very uncertain if I ever will. Cheers.

Please or to participate in this conversation.