I'm executing ng serve
and it fails to compile after the chunks are produced.
The same repository is working on a colleague's machine, with same versions as below:
Also tried:
npm i
after force cleaning the npm cache.Command executed: ng serve
The error is:
ERROR in ./src/assets/css/style.css (./node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./src/assets/css/style.css)
Module build failed (from ./node_modules/postcss-loader/src/index.js):
TypeError: Cannot read property 'type' of undefined
at /home/akashj/workspace/projects/frontEnd/src/assets/css/style.css:1999:3
at stringifyNode (/home/akashj/workspace/projects/frontEnd/node_modules/postcss-value-parser/lib/stringify.js:2:19)
at Function.stringify (/home/akashj/workspace/projects/frontEnd/node_modules/postcss-value-parser/lib/stringify.js:45:10)
at Gradient.colorStops (/home/akashj/workspace/projects/frontEnd/node_modules/autoprefixer/lib/hacks/gradient.js:505:26)
at Gradient.oldWebkit (/home/akashj/workspace/projects/frontEnd/node_modules/autoprefixer/lib/hacks/gradient.js:398:10)
at Gradient.replace (/home/akashj/workspace/projects/frontEnd/node_modules/autoprefixer/lib/hacks/gradient.js:91:30)
at Gradient.add (/home/akashj/workspace/projects/frontEnd/node_modules/autoprefixer/lib/value.js:148:20)
at Gradient.add (/home/akashj/workspace/projects/frontEnd/node_modules/autoprefixer/lib/hacks/gradient.js:572:35)
at Gradient.process (/home/akashj/workspace/projects/frontEnd/node_modules/autoprefixer/lib/prefixer.js:157:16)
at /home/akashj/workspace/projects/frontEnd/node_modules/autoprefixer/lib/processor.js:327:15
at /home/akashj/workspace/projects/frontEnd/node_modules/postcss/lib/container.js:190:18
at /home/akashj/workspace/projects/frontEnd/node_modules/postcss/lib/container.js:135:18
at Rule.each (/home/akashj/workspace/projects/frontEnd/node_modules/postcss/lib/container.js:101:16)
at Rule.walk (/home/akashj/workspace/projects/frontEnd/node_modules/postcss/lib/container.js:131:17)
at /home/akashj/workspace/projects/frontEnd/node_modules/postcss/lib/container.js:148:24
at Root.each (/home/akashj/workspace/projects/frontEnd/node_modules/postcss/lib/container.js:101:16)
at Root.walk (/home/akashj/workspace/projects/frontEnd/node_modules/postcss/lib/container.js:131:17)
ℹ 「wdm」: Failed to compile.
For the whole console output of ng serve
: https://pastebin.com/maHX3pCC
I resolved it. The CSS on that line (shown below) had a comma at the end and had no values after that. And postcss was throwing error due to that.
background-image: linear-gradient(to right, #973a95, #055faa, );
Removed the comma and it worked as expected
background-image: linear-gradient(to right, #973a95, #055faa);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With