When using postcss v7.0.20 the webpack compilation fails with the following stack trace.
✖ 「wdm」: TypeError: Cannot read property 'value' of undefined
at /Users/username/workspaces/terra/terra-core/9.css:220:3
at new Quoted (/Users/username/workspaces/terra/terra-core/node_modules/postcss-values-parser/lib/nodes/Quoted.js:19:28)
at cloneNode (/Users/username/workspaces/terra/terra-core/node_modules/postcss/lib/node.js:15:16)
at Quoted.clone (/Users/username/workspaces/terra/terra-core/node_modules/postcss/lib/node.js:248:18)
at Func.Node (/Users/username/workspaces/terra/terra-core/node_modules/postcss/lib/node.js:83:30)
at new Container (/Users/username/workspaces/terra/terra-core/node_modules/postcss/lib/container.js:45:18)
at new Container (/Users/username/workspaces/terra/terra-core/node_modules/postcss-values-parser/lib/nodes/Container.js:15:1)
at new Func (/Users/username/workspaces/terra/terra-core/node_modules/postcss-values-parser/lib/nodes/Func.js:19:5)
at asClonedNode (/Users/username/workspaces/terra/terra-core/node_modules/postcss-custom-properties/index.cjs.js:254:21)
at array.map.node (/Users/username/workspaces/terra/terra-core/node_modules/postcss-custom-properties/index.cjs.js:250:60)
at Array.map (<anonymous>)
at asClonedArray (/Users/username/workspaces/terra/terra-core/node_modules/postcss-custom-properties/index.cjs.js:250:48)
at asClonedArrayWithBeforeSpacing (/Users/username/workspaces/terra/terra-core/node_modules/postcss-custom-properties/index.cjs.js:240:23)
at root.nodes.slice.forEach.child (/Users/username/workspaces/terra/terra-core/node_modules/postcss-custom-properties/index.cjs.js:213:44)
at Array.forEach (<anonymous>)
at transformValueAST (/Users/username/workspaces/terra/terra-core/node_modules/postcss-custom-properties/index.cjs.js:193:24)
at root.walkDecls.decl (/Users/username/workspaces/terra/terra-core/node_modules/postcss-custom-properties/index.cjs.js:275:28)
I have confirmed that this commit introduced this error by reverting to v7.0.19 and verifying no error was thrown and then again by upgrading to v7.0.20 and verifying the error is thrown. Additionally I manually updated the code within node_modules while using v7.0.20 to revert to the previous looping logic and verified no error was thrown.
for (let i of defaults[name]) this.append(i)
We're still looking into exactly what is causing the error, but I wanted to make sure the issue was logged incase a quick solution/fix from the perspective of the maintainers of this library could be made.
(This is a rather large project, I'll work on creating a smaller sample project)
I am working on it :+1:
Sorry, I can’t run npm install on your project.
Can you reduce the case for the simple project with less dependencies?
I found the problem. But it will be hard to fix it quickly.
I reported issue https://github.com/TrySound/postcss-value-parser/issues/60
I reverted PostCSS 7.0.19 feature b8ce024
There is no way to fix. I will move it to next major 8.0 release.
Thank you for being so responsive!!
The fix was released in 7.0.21
postcss-values-parser is the culprit here, not so much PostCSS. This line from the stack is the clue:
at new Quoted (/Users/username/workspaces/terra/terra-core/node_modules/postcss-values-parser/lib/nodes/Quoted.js:19:28)
I added a note 26b4a76
Most helpful comment
The fix was released in 7.0.21