vincej's avatar
Level 15

Can't Find 2 Errors in Laravel Mix

I'm getting two errors when I run Mix, and they make no sense to me:

Error 1

ERROR in ./resources/css/app.css
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/css-loader/dist/cjs.js):
Error: Can't resolve 'resources/css/default.css' in '/Users/vincejacobs/Sites/contraxiq/resources/css'

This makes no sense, as I import all my .css files into app.css like this:

@import url(https://fonts.googleapis.com/css?family=Nunito);
@import 'appOverride.css';
@import 'bootstrapTheme.css';
@import 'bootstrapOverride.css';
@import 'resources/css/default.css';
@import 'resources/css/favicon.png';
@import 'resources/css/help.css';
@import 'resources/css/jqueryui.css';
@import 'resources/css/mobile.css';

@charset "UTF-8";

I have triple checked the spelling and location of ``'resources/css/default.css' in my project files and it is 100% correct.

Laravel Mix

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')
    .sass('resources/sass/app.scss', 'public/css')
    .css('resources/css/app.css','public/css');

Lastly, there is a whole bunch of stack trace references which Mix has supplied, but I don't understand any of those.

 at finishWithoutResolve (/Users/vincejacobs/Sites/contraxiq/node_modules/enhanced-resolve/lib/Resolver.js:309:18)
    at /Users/vincejacobs/Sites/contraxiq/node_modules/enhanced-resolve/lib/Resolver.js:386:15
    at /Users/vincejacobs/Sites/contraxiq/node_modules/enhanced-resolve/lib/Resolver.js:435:5
    at eval (eval at create (/Users/vincejacobs/Sites/contraxiq/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:16:1)
    at /Users/vincejacobs/Sites/contraxiq/node_modules/enhanced-resolve/lib/Resolver.js:435:5
    at eval (eval at create (/Users/vincejacobs/Sites/contraxiq/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:27:1)
    at /Users/vincejacobs/Sites/contraxiq/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js:87:43
    at /Users/vincejacobs/Sites/contraxiq/node_modules/enhanced-resolve/lib/Resolver.js:435:5
    at eval (eval at create (/Users/vincejacobs/Sites/contraxiq/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)
    at /Users/vincejacobs/Sites/contraxiq/node_modules/enhanced-resolve/lib/Resolver.js:435:5
    at processResult (/Users/vincejacobs/Sites/contraxiq/node_modules/webpack/lib/NormalModule.js:758:19)
    at /Users/vincejacobs/Sites/contraxiq/node_modules/webpack/lib/NormalModule.js:860:5
    at /Users/vincejacobs/Sites/contraxiq/node_modules/loader-runner/lib/LoaderRunner.js:400:11
    at /Users/vincejacobs/Sites/contraxiq/node_modules/loader-runner/lib/LoaderRunner.js:252:18
    at context.callback (/Users/vincejacobs/Sites/contraxiq/node_modules/loader-runner/lib/LoaderRunner.js:124:13)
    at Object.loader (/Users/vincejacobs/Sites/contraxiq/node_modules/css-loader/dist/index.js:155:5)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Error Two

1 ERROR in child compilations (Use 'stats.children: true' resp. '--stats-children' for more details)

I do not understand what this means.

0 likes
2 replies
tykus's avatar
tykus
Best Answer
Level 104

Use relative path for your stylesheets, e.g.

@import './default.css';
@import './favicon.png';
@import './help.css';
@import './jqueryui.css';
@import './mobile.css';
vincej's avatar
Level 15

Many Thanks! Your advice solved it.

My second problem was solved by running npm install [email protected] --save-exact

I still have a load of recommendations which appear to belong to Bootstrap 4.6. I will upgrade to BS 5.

Please or to participate in this conversation.