Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js): #91

Open
abanghendri opened this issue Aug 3, 2022 · 7 comments

Comments

@abanghendri
Copy link

Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):

To Reproduce
Hi, I'm installing laravel 8 and try to swap the jetstream from tailwind to bootstrap, but when I run 'npm run dev', it produce these errors

ERROR in ./resources/sass/app.scss
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/postcss-loader/dist/cjs.js):
TypeError: Cannot read property 'config' of undefined
    at getTailwindConfig (/projects/la/backoffice/node_modules/tailwindcss/lib/lib/setupTrackingContext.js:87:63)
    at /projects/la/backoffice/node_modules/tailwindcss/lib/lib/setupTrackingContext.js:129:92
    at /projects/la/backoffice/node_modules/tailwindcss/lib/processTailwindFeatures.js:46:11
    at plugins (/projects/la/backoffice/node_modules/tailwindcss/lib/index.js:33:63)
    at LazyResult.runOnRoot (/projects/la/backoffice/node_modules/postcss/lib/lazy-result.js:339:16)
    at LazyResult.runAsync (/projects/la/backoffice/node_modules/postcss/lib/lazy-result.js:393:26)
    at LazyResult.async (/projects/la/backoffice/node_modules/postcss/lib/lazy-result.js:221:30)
    at LazyResult.then (/projects/la/backoffice/node_modules/postcss/lib/lazy-result.js:206:17)
    at processResult (/projects/la/backoffice/node_modules/webpack/lib/NormalModule.js:758:19)
    at /projects/la/backoffice/node_modules/webpack/lib/NormalModule.js:860:5
    at /projects/la/backoffice/node_modules/loader-runner/lib/LoaderRunner.js:400:11
    at /projects/la/backoffice/node_modules/loader-runner/lib/LoaderRunner.js:252:18
    at context.callback (/projects/la/backoffice/node_modules/loader-runner/lib/LoaderRunner.js:124:13)
    at Object.loader (/projects/la/backoffice/node_modules/postcss-loader/dist/index.js:142:7)

1 ERROR in child compilations (Use 'stats.children: true' resp. '--stats-children' for more details)
webpack compiled with 2 errors
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ development: `mix`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ development script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/xdemia/.npm/_logs/2022-08-03T08_58_48_872Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ dev: `npm run development`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/xdemia/.npm/_logs/2022-08-03T08_58_48_981Z-debug.log

this is my package version

"php": "^7.3|^8.0",
        "fruitcake/laravel-cors": "^2.0",
        "guzzlehttp/guzzle": "^7.0.1",
        "laravel/framework": "^8.75",
        "laravel/jetstream": "^2.9",
        "laravel/sanctum": "^2.11",
        "laravel/tinker": "^2.5",
        "livewire/livewire": "^2.5"
@yalcincoruh
Copy link

The color-adjust shorthand is currently deprecated and it depends on the autoprefixer@10.4.6

I was able to fix this by reverting the autoprefixer package as well as @benno to version 10.4.5. Run this:
npm install autoprefixer@10.4.5 --save-exact

@abanghendri
Copy link
Author

thanks @yalcincoruh , but it not work for me, I still get the same issue after running npm install autoprefixer@10.4.5 --save-exact

@harryspink
Copy link

harryspink commented Aug 4, 2022

It's trying to find the tailwind config file. Create an empty file called tailwind.config.js at the root of your Laravel project.

@abanghendri
Copy link
Author

but tailwind.config.js is already exists

@yalcincoruh
Copy link

yalcincoruh commented Aug 5, 2022

There are alternative solutions at this address :
https://stackoverflow.com/questions/72083968/1-warning-in-child-compilations-use-stats-children-true-resp-stats-child

in the package.json file
"autoprefixer": "^10.4.5",
edit your line like this and do npm install again

@unknownentity1337
Copy link

I also had the same error

@Evrard01
Copy link

i have the same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants