Build Error with Windows: Validation Error

Hi all,

Sorry for rehashing something previously discussed, I couldn’t post in the other closed threads.

My question is essentially the same as:
https://discourse.roots.io/t/bud-build-error/21744
I even went through the same steps as @Al_Sherif_Ahmed_Khal
And receive the same error message.
ValidationError: Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.

The solution was to use WSL? Which I’m totally unfamiliar with.

After searching I see a post from @Log1x
[Guide] Developing on Windows 10 using WSL
However is a few years old now, not certain if everything in there is still relevant?

Is there any other reading / video that anyone could kindly point me to, to help me get my head around this stuff?

And just to confirm, it seems I have to use this WSL now? I can’t develop with Sage how I used to anymore within Windows?

Thanks in advance.

1 Like

I answered this in How to install/configure Sage 10 on Windows?

The short, WSL is a requirement of Bud for using the Sage asset build tools. So you have to setup your dev environment within WSL.

I left some links to resources there that should help, but you really do have to read up on what WSL is and how to set it up before anything else.

I saw someone did a fork to use Laravel Mix instead of Bud, which I think might work fine and not require WSL? So that could be an option, as it is a chore if you haven’t dealt with WSL before and gotten it configured.

I ultimately resigned myself to working on my Mac instead, as I didn’t want to spend more time to setup a local dev server within WSL. I normally just use Local by Flywheel, but ran into a conflict where Acorn’s WP CLI command wasn’t available. I’m not sure if this old issue on Github is related, but it was only happening to me on Windows and not macOS, and so that’s the point at which I gave up: If WP-CLI argument '--allow-root' is set, CLI isn't working · Issue #48 · roots/acorn · GitHub

edit: here’s the thread re: replacing Bud with Mix - Sage 10 with Laravel Mix instead of Bud

1 Like

If you’re unfamiliar with WSL, it’s basically linux running on windows.
Fireship has a great video explaining it: BEST Web Dev Setup? Windows & Linux at the same time (WSL) - YouTube

If you want to use sage without bud, I made a version with laravel mix instead, no WSL needed:

2 Likes

After muddling through the WSL setup process and getting oh-so-close to it working but not quite, I very much appreciate you sharing your non-WSL-required version of Sage! I will be giving that a try as soon as I have some time :slight_smile: Thank you!

2 Likes

Thanks @heyharvest, I appreciate all of the information, sorry that I also didn’t see your other reply in the other post.
@patrickzach Thank you too, that video is great.
I’ll have a play around this evening and see if I can get everything going, if not I’ll give your laravel mix version a go.

Awesome, there’s probably lots more I need to mess around with, but got WSL going and the Sage build compiled, thanks all again.

I was in a similar situation, but it turned out not to be as complex as it sounds.

Installing WSL meant running the following from Power Shell.
wsl --install
The only complication was that I had to enable Virtualisation within my BIOS.

I downloaded the Windows Terminal, which allowed me to easily login to my new Ubuntu setup.
I just selected Ubuntu from the drop down in the taskbar.

I changed to the theme directory with the ‘cd’ command.
The path is very similar to Windows, but the start changes slightly.
E.G. C:\ becomes /mnt/c/ and all other backslashes in the path, need replacing with forward slashes.

You can then start to run the commands detailed in the Installation docs…
‘nvm install --lts’
‘npm install --global yarn’
‘yarn’
‘yarn build’

Once the build process had taken place, I continued with my local development within the Windows environment, using Laragon.

Hopefully, this information is of help to you.

@unicorn_in_training Apologies, if I under estimated the steps that you’d already tried.

I’ve since read the following and decided Laragon wasn’t a viable option…
" To take advantage of the improved speed, Microsoft recommends that you keep your project’s files inside of the Linux environment, and do most of your work there. Working with Windows files in Linux (or the other way around) can be much slower. That means that traditional Windows dev environments like Laragon or Local are out."
Source: Switching to Windows for Local WordPress Development

I found this video a huge help with setting up Docker on Windows…