WebCompiler icon indicating copy to clipboard operation
WebCompiler copied to clipboard

SCSS unit tests failing due to error in node package

Open Velociraptor45 opened this issue 1 year ago • 0 comments

Installed product versions

  • Visual Studio: 2022 Community
  • This extension: 1.14.10

Description

Some SCSS unit tests are failing due to an error during the SCSS compilation.

Steps to recreate

  1. Clone the repo
  2. Remove the current WebCompiler folder from the temp directory
  3. Remove the node_modules.7z file from src/WebCompiler/Node if it exists
  4. Rebuild node_modules.7z
  5. Compile the solution
  6. Execute unit tests

Current behavior

The unit tests ScssTest.CompileScss and ScssTest.MultiLineComments are currently failing. If you put a breakpoint at the return in the ConfigFileProcessor line 195, you'll see an early exit because of an error during the compilation (error message below). It seems like this is caused by the AutoPrefix option because when I remove it from the scssconfig.json for example, the ScssTest.CompileScss still fails (because it evaluates for the AutoPrefix) but the compilation process itself is successful.

node:internal/modules/cjs/loader:933
  const err = new Error(message);
              ^

Error: Cannot find module '../doc/directives.js'
Require stack:
- C:\Users\david\AppData\Local\Temp\WebCompiler1.14.10\node_modules\yaml\dist\compose\composer.js
- C:\Users\david\AppData\Local\Temp\WebCompiler1.14.10\node_modules\yaml\dist\index.js
- C:\Users\david\AppData\Local\Temp\WebCompiler1.14.10\node_modules\postcss-load-config\src\index.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:94:18)
    at Object.<anonymous> (C:\Users\david\AppData\Local\Temp\WebCompiler1.14.10\node_modules\yaml\dist\compose\composer.js:3:18)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\david\\AppData\\Local\\Temp\\WebCompiler1.14.10\\node_modules\\yaml\\dist\\compose\\composer.js',
    'C:\\Users\\david\\AppData\\Local\\Temp\\WebCompiler1.14.10\\node_modules\\yaml\\dist\\index.js',
    'C:\\Users\\david\\AppData\\Local\\Temp\\WebCompiler1.14.10\\node_modules\\postcss-load-config\\src\\index.js'
  ]
}

Expected behavior

All unit tests are green.

Velociraptor45 avatar Jul 29 '23 18:07 Velociraptor45