creativetimofficial / ct-paper-kit-2-pro-angular

Paper Kit 2 PRO Angular version
2 stars 6 forks source link

[Bug] Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js): #14

Closed securekomodo closed 3 years ago

securekomodo commented 3 years ago

Version

1.4.0

Reproduction link

N/A

Operating System

OSX

Device

Mac

Browser & Version

Firefox (latest)

Steps to reproduce

Failure occurs when NPM is building after updating NPM vulnerabilities.

WORKS npm install -g @angular/cli@latest npm install npm start

DOES NOT WORK npm install -g @angular/cli@latest npm install npm audit fix (fixes high severity vulns) npm start (fails during start)

Error: ./src/assets/scss/paper-kit.scss Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js): ModuleError: Module Error (from ./node_modules/postcss-loader/dist/cjs.js): (Emitted value instead of an instance of Error) CssSyntaxError: /Users/username/paper-kit/_examples.scss:570:8: Can't resolve './paper-kit/assets/img/farid-askerov.jpg' in '/Users/username/Documents/Development/website/src/assets/scss'

568 | } 569 | .blog-header-image{

570 | background-image: url('assets/img/farid-askerov.jpg'); | ^ 571 | } 572 | .navbar{

at Object.emitError (/Users/username/Documents/Development/website/node_modules/webpack/lib/NormalModule.js:173:6)
at /Users/username/Documents/Development/website/node_modules/@angular-devkit/build-angular/src/webpack/plugins/postcss-cli-resources.js:125:28
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Promise.all (index 6)

Specifically, the default version of @angular-devkit/build-angular is vulnerable to some high severity vulnerabilities. Prior to it updating, the web app works just fine. after updating npm install --save-dev @angular-devkit/build-angular@0.1100.1 then the failure occurs

What is expected?

the build should pass as nothing has been changed on the template site, it was freshly downloaded from your repo, all I did was update NPM and dependencies which are vulnerable

What is actually happening?

build is failing so unable to run app


Solution

npm i @angular-devkit/build-angular@0.901.12

Additional comments

securekomodo commented 3 years ago

By placing various levels of ../../ in the files specified in the errors I was able to clear some of the issues on building. Now I am getting a specific error

Error: TypeError: tooling_1.constructorParametersDownlevelTransform is not a function

I believe most of this is because the app is not updated for newer builds...

I reverted back to [npm i @angular-devkit/build-angular@0.901.12] and it renders perfectly with no vulnerabilities