Laravel-mix: build empty css when using .js and .react together

Created on 25 Jun 2019  路  6Comments  路  Source: JeffreyWay/laravel-mix

  • Laravel Mix Version: #.#.# (npm list --depth=0) 4.0.16
  • Node Version (node -v):11.15.0
  • NPM Version (npm -v): 6.9.0
  • OS: linux Manjaro

Description:

build empty css when using .js and .react together

Steps To Reproduce:

build empty css

mix.react('resources/js/admin/app.js', 'public/js/admin')
.js('resources/js/web/app.js', 'public/js/web')
.sass('resources/sass/web/app.scss', 'public/css/web');

if you comment out .react or .js with sss build correctly

mix.react('resources/js/admin/app.js', 'public/js/admin')
//.js('resources/js/web/app.js', 'public/js/web')
.sass('resources/sass/web/app.scss', 'public/css/web');

or
mix.js('resources/js/web/app.js', 'public/js/web')
.sass('resources/sass/web/app.scss', 'public/css/web');

stale

Most helpful comment

As by @JeffreyWay https://github.com/JeffreyWay/laravel-mix/issues/2123#issuecomment-500421264 This is because of dynamic imports problem. And till the new webpack released , there is a temporary workaround for this problem by making a separate mix files for js and scss.
Please refere to this comment posted by @vesaka in https://github.com/JeffreyWay/laravel-mix/issues/1914#issuecomment-503392761

All 6 comments

same here

I'm having the same problem.. It started out of nowhere.

I've tried removing the node_modules folder and running npm install and still spits out an empty css file.

I have the same issue when I use VueJS.

the .extract([vue]) on my config is messing it up.

As by @JeffreyWay https://github.com/JeffreyWay/laravel-mix/issues/2123#issuecomment-500421264 This is because of dynamic imports problem. And till the new webpack released , there is a temporary workaround for this problem by making a separate mix files for js and scss.
Please refere to this comment posted by @vesaka in https://github.com/JeffreyWay/laravel-mix/issues/1914#issuecomment-503392761

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

actual problem

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kpilard picture kpilard  路  3Comments

terion-name picture terion-name  路  3Comments

amin101 picture amin101  路  3Comments

jpmurray picture jpmurray  路  3Comments

rderimay picture rderimay  路  3Comments