uswds / uswds-compile

Simple Gulp 4 functions for copying USWDS static assets and transforming USWDS Sass into browser-readable CSS.
Other
21 stars 12 forks source link

USWDS-Compile - Bug: Platform specific sass-embedded modules are missing from package lock #110

Closed mdmower-csnw closed 1 month ago

mdmower-csnw commented 1 month ago

Describe the bug

This only affects the develop branch; it is a regression introduced by #96. Platform specific sass-embedded modules are missing for all but darwin-arm64. This results in a compilation error when any other platform is used to run npm run init after cleanly installing packages.

Steps to reproduce the bug

Tested on both Windows x64 and Debian 12 x64:

git checkout develop # reset to match upstream if needed
npm ci
npm run init

Error from Windows:

npm run init

> @uswds/compile@1.1.0 init
> gulp init

Error: Embedded Dart Sass couldn't find the embedded compiler executable. Please make sure the optional dependency sass-embedded-win32-x64 is installed in node_modules.

Error from Linux:

npm run init

> @uswds/compile@1.1.0 init
> gulp init

Error: Embedded Dart Sass couldn't find the embedded compiler executable. Please make sure the optional dependency sass-embedded-linux-x64 is installed in node_modules.

Expected Behavior

Compilation should succeed because the platform specific sass-modules are installed.

Related code

main branch: https://github.com/uswds/uswds-compile/blob/6a6b1339099bb3a200a11bc336626f1f5daa3fde/package-lock.json#L4323-L4491

develop branch: https://github.com/uswds/uswds-compile/blob/2d7750ad74e84c7e34813870a89ae15d62b1dc5c/package-lock.json#L2636-L2673

Screenshots

No response

System setup

No response

Additional context

I would normally suggest regenerating package-lock.json entirely...

rm -rf node_modules/
rm package-lock.json
npm install

... but you'd have to be willing to accept any version bumps in other packages that meet the version criteria from package.json. So, if that's not acceptable, focus on just sass-embedded:

npm uninstall --save sass-embedded
npm install --save sass-embedded@1.77.5
# edit package.json to remove ^ from version so that it matches the current restriction of using an exact version
npm install

Code of Conduct

mahoneycm commented 1 month ago

Hey there @mdmower-csnw, thanks for catching this!

I wasn't able to recreate this on my machine but we experienced as similar issue on USWDS-Site. We were able to resolve it by installing sass-embedded's optional dependences.

I created #111 to see if this would resolve the issue for you. Would you mind checking to see if this resolves the error on your machines?

Thanks!

mdmower-csnw commented 1 month ago

@mahoneycm

I created #111 to see if this would resolve the issue for you. Would you mind checking to see if this resolves the error on your machines?

The updates to package-lock.json look complete (matches list of optionalDependencies for sass-embedded) and I verified I can compile successfully on both Windows 11 64bit and Debian 12 64bit.

mejiaj commented 1 month ago

Confirming error on win11 x64.

Windows PowerShell 7_16_2024 8_27_57 AM