Issue with Sage 10 and Webpack Install

Hey Everyone,

I’m not new to sage itself, developed in it in a previous position. I am, however, new to setting it up on my own. I’m following the steps provided at Sage 10.x: Installation | Roots Documentation but I keep running into the following error when running yarn build:

✖  ValidationError: Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
 - configuration[0].resolve.modules[2] should be a non-empty string.
   -> Folder name or directory path where to find modules.
    at validate (C:\Users\chiller\Documents\ThriveMS\wp-content\themes\thrive\node_modules\schema-utils\dist\validate.js:105:11)
    at validateSchema (C:\Users\chiller\Documents\ThriveMS\wp-content\themes\thrive\node_modules\webpack\lib\validateSchema.js:78:2)
    at create (C:\Users\chiller\Documents\ThriveMS\wp-content\themes\thrive\node_modules\webpack\lib\webpack.js:111:24)
    at webpack (C:\Users\chiller\Documents\ThriveMS\wp-content\themes\thrive\node_modules\webpack\lib\webpack.js:158:32)
    at Compiler.invoke (C:\Users\chiller\Documents\ThriveMS\wp-content\themes\thrive\node_modules\@roots\bud-compiler\lib\cjs\Compiler\compiler.service.js:85:47)
    at async Compiler.compile (C:\Users\chiller\Documents\ThriveMS\wp-content\themes\thrive\node_modules\@roots\bud-compiler\lib\cjs\Compiler\compiler.service.js:75:26)
    at async production (C:\Users\chiller\Documents\ThriveMS\wp-content\themes\thrive\node_modules\@roots\bud-api\lib\cjs\api\methods\run\index.js:10:26)
    at async Bud.run (C:\Users\chiller\Documents\ThriveMS\wp-content\themes\thrive\node_modules\@roots\bud-api\lib\cjs\api\methods\run\index.js:14:54)
    at async Api.call (C:\Users\chiller\Documents\ThriveMS\wp-content\themes\thrive\node_modules\@roots\bud-api\lib\cjs\api\api.service.js:101:16)
    at async BuildCommand.run (C:\Users\chiller\Documents\ThriveMS\wp-content\themes\thrive\node_modules\@roots\bud\lib\cjs\cli\commands\base.js:81:9)
Internal Error: ValidationError: Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
 - configuration[0].resolve.modules[2] should be a non-empty string.
   -> Folder name or directory path where to find modules.
 - configuration[0].resolve.modules[2] should be a non-empty string.
   -> Folder name or directory path where to find modules.
    at Bud.error (C:\Users\chiller\Documents\ThriveMS\wp-content\themes\thrive\node_modules\@roots\bud-framework\lib\cjs\Framework\index.js:544:15)
    at Bud.run (C:\Users\chiller\Documents\ThriveMS\wp-content\themes\thrive\node_modules\@roots\bud-api\lib\cjs\api\methods\run\index.js:17:13)
    at async Api.call (C:\Users\chiller\Documents\ThriveMS\wp-content\themes\thrive\node_modules\@roots\bud-api\lib\cjs\api\api.service.js:101:16)
    at async BuildCommand.run (C:\Users\chiller\Documents\ThriveMS\wp-content\themes\thrive\node_modules\@roots\bud\lib\cjs\cli\commands\base.js:81:9)
    at async BuildCommand.execute (C:\Users\chiller\Documents\ThriveMS\wp-content\themes\thrive\node_modules\@roots\bud\lib\cjs\cli\commands\build.js:211:9)
    at async BuildCommand.validateAndExecute (C:\Users\chiller\Documents\ThriveMS\wp-content\themes\thrive\node_modules\clipanion\lib\advanced\Command.js:67:26)
    at async Cli.run (C:\Users\chiller\Documents\ThriveMS\wp-content\themes\thrive\node_modules\clipanion\lib\advanced\Cli.js:236:24)

I wish I was on a Mac or Linux system doing this, but I am on a Windows 10 install with Docker.

I am running the following versions
webpack: 5.68.0
webpack-cli: 4.9.2
node: v16.6.0

Any help figuring this out would be greatly appreciated!

~Charlie

Hi @chiller,

Sounds like what I went through a few days ago.
https://discourse.roots.io/t/build-error-with-windows-validation-error/22566
In Windows, Sage 10 requires you to work within WSL, the info received in my previous thread helped me get it working.

Not certain about how Docker will complicate this, perhaps someone else can weigh in or you will be able to figure it out after reading that other thread.

Ah interesting. I’ll give this all a read and get my WSL environment set up and give it a shot. I don’t think docker will interfere much as I’m running the file system outside the container locally so there is no issues accessing it. I’ll report back once I give it a go! Thanks!

@pmang Got a Ubuntu install going on WSL and smooth sailing with the build. Thanks so much for your help!

2 Likes