-
Notifications
You must be signed in to change notification settings - Fork 807
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
.extract() leads to empty .css files #1914
Comments
Not sure if the roots of the problem could be the same as in this bug : #1889 |
Same issue on 4.0.13 |
Related to #1887 . Answer seems to be don't upgrade yet if using SCSS |
No, answer is don't upgrade if you're using dynamic imports. See the Mix 4 release notes. |
Yeah, saw those - just missed them when trying to upgrade. I took a look at webpack 5 and it appears they are only at 20% :/ Biggest thing my team is missing from 2.x is the new multi-config that you dropped last month so we can do multiple tailwind configurations. Think it's even possible to get it in 2.x? |
Well... we have to do not use There is a note in
I'm having #1889 problem too. 😢 But without |
Same problem here. However, css compiles successfully when I remove |
You are telling me there is no way this can be fixed in the current setup? |
Running into this as well. In my case, we've been using FWIW, I created a new, clean Laravel / React project and implemented both SASS compiling and code splitting, and things worked just fine. Added in Update: Looks like |
This problem is not resolved? I also use |
same issue as well on mix ^4.0.7 |
Today I faced the same issue. So here's a workaround I found.
Next step is to add new scripts into your package.json file
NOTE: On this step, make sure to match that --env.mixfile option with the second webpack file. Final step: I hope it helps. |
@vesaka you won't need 2 terminal windows, just |
Second command and maybe even better, instead of So that way, everything back to what they used to be. Same command. No hassle to inform co-devs. |
@rmondesilva take a look at this repo https://github.com/euclid1990/laravel |
Followed @vesaka's and @rmondesilva's suggestions and it's working fine on a fresh install of Laravel (using Laravel Mix v4.0.7). |
npm --section=app run watch -- --watch-poll & npm --section=admin run watch -- --watch-poll windows 10 -- ok |
I come up with this workaround by inspiring @vesaka 's answer. Instead of using different webpack config files I've controlled extracting and scss compiling with environmental variables: So my compiling commands in package.json become:
And my dynamic control area in webpack.mix.js:
And lastly if you need manifest files for dealing Browser Caching, either you can use @plumpboy 's solution or set publicPaths at the same way:
|
This is still an issue, even now in the 5.0 version. The workarounds are not suitable for me. |
little archaic solution but very helpful |
Same problem here , thanks to post it.... thank god I dont update my webpack version to check if that work.. |
Same here, If I add |
Glad to see that I'm not the only one needing this to be fixed. By the way @JeffreyWay, could you reopen the issue please? |
Same here, getting empty app.css with .extract() |
Same thing is happening for one of my projects as well. |
@keradan For the time being you can probably use split you mix file into two and work that way. I'll post my setup shortly. Install laravel-mix-merge-manifest
Update your package.json's scripts section to:
|
@ilamp |
I've updated the instructions. Please try it now. |
@ilamp |
@HartleySan
|
Yes, I did. I tried both
And here're my
Any ideas? Thanks. |
Hmm I am relatively new to too this too, but let me post my mix
and my js and css mix files
Also I am using iTerm for my editor? maybe that affects it. |
@chrisgrim All the same, after making the changes and trying, still, the same end result. I am using Windows 10, but with the Git Bash terminal integrated into Visual Studio Code, so not sure why that would matter. I will continue to investigate. Thanks. |
Sorry I couldn't help more. I will play with it a bit on my end and see if I can't find something else. |
@HartleySan Try using |
Thanks for the reply, ilamp. I tried |
@rmondesilva was suggesting that without concurrently one of the two commands is not working. I installed it without trying other solutions and it has worked.
I'm using two config files ( "scripts": {
"css-dev": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --env.mixfile=webpack.mix.css --config=node_modules/laravel-mix/setup/webpack.config.js",
"js-dev": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"development": "concurrently \"npm run css-dev\" \"npm run js-dev\"",
"css-watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --watch --hide-modules --env.mixfile=webpack.mix.css --config=node_modules/laravel-mix/setup/webpack.config.js",
"js-watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --watch --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "concurrently \"npm run css-watch\" \"npm run js-watch\"",
"watch-poll": "npm run watch -- --watch-poll",
"css-production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --env.mixfile=webpack.mix.css --config=node_modules/laravel-mix/setup/webpack.config.js",
"js-production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"production": "concurrently \"npm run css-production\" \"npm run js-production\"",
"dev": "npm run development",
"prod": "npm run production"
} Last two ones are obviously just aliases, and I don't believe I have ever used (I'm also using |
That npm module |
it's sad to see this issue still open after one year |
Indeed. So surprised why this hasn't been resolved yet. Really makes the build process, which is already a confusing black box, even more confusing. |
It happens when I use React.lazy |
Any news on this? |
@dkaufmann96 there is a gist with an example of concurrently and tailwind separately here: https://gist.github.com/Jossnaz/7cf182e794e515d068159ad71fcf7855 look at the seems like he is busy with other interesting ideas |
A very simple example that causes this problem: CSS file is generated w/o problem:
CSS is 0 Bytes:
note that Not sure if this is in any way helpfull... but who knows! |
@jossnaz thank you, I ended up using the workaround described in #2070 (comment). |
Just to clarify. This was a known issue with Mix and webpack 4. We tried for a long time to resolve it, but every option ended up breaking a different part of the Mix API. The problem is solved in Mix v6 which now uses webpack 5. |
Great to hear, Jeffrey. Any ETA on a Mix v6 release? Thank you. |
This coming week. |
any release of Mix v6 ? thx |
Nvm I was using multiple extracts and forgot to add the |
Hello! |
For my initial testing, this seems to resolve my issue. I was unable to get the multiple watch commands to work, as I was running multiple mix commands with different configs, but using concurrently helped. I am using laravel-mix: "^6.0.49". |
npm list --depth=0
)node -v
): v10.10.0npm -v
): 6.5.0Description:
css files are empty (0 bytes), with no error, whenever a js file has been processed before.
leads to a 0 bytes css file whenever
creates the wanted css.
Steps To Reproduce:
Running
npm run dev
ornpm run prod
. Specifying the array of libs you want to extract (.extract([...])
) or letting Mix do the guessing job (.extract()
) does not change the problem.Output in the first case:
and in the second case:
The text was updated successfully, but these errors were encountered: