简体   繁体   中英

I'm trying to install Laravel breeze but I keep getting Laravel Mix errors

I'm trying to install Laravel Breeze in my new laravel application.

Everything used to work fine but when type npm run dev in the console I keep getting this error:

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

I think everything works fine but my login and register page are not styled. I also can´t find any solutions on the internet. I've tried to install Breeze in multiple new projects but this error keeps showing up.

Does anyone know how to fix this?

I've installed Breeze doing this:

  1. composer require laravel/breeze
  2. php artisan breeze:install
  3. npm install
  4. npm run dev (this gives me the error)

When I navigate to the login page this line shows up at the top of the page:

@vite(['resources/css/app.css', 'resources/js/app.js'])

You are using the wrong version of breeze. Take a look at this answer: https://stackoverflow.com/a/72854279/9098325

To compile your mix you have to npm install autoprefixer@10.4.5 --save-exact before mixing. Found this solution here: https://stackoverflow.com/a/72097301/9098325

For some reason, you may sometime have to run npm run dev multiple times, when the mix compilation fails. Often when working with new projects, I have to do it. See if this helps.

In order for your page to work fine include this above @vite(['resources/css/app.css', 'resources/js/app.js']), then run npm run dev again. It should work fine now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM