TypeError: Cannot read property 'value' of undefined
See original GitHub issueIssue
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)
Details
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.
Steps to Reproduce
(This is a rather large project, I’ll work on creating a smaller sample project)
- git clone https://github.com/cerner/terra-core.git
- cd terra-core
- npm install
- npm start
- Observe the stack trace above
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:9 (8 by maintainers)
Top Results From Across the Web
TypeError: Cannot read property 'value' of Undefined in JS
To solve the "Cannot read property 'value' of undefined" error, make sure that the DOM element you are accessing exists. The error is...
Read more >Uncaught TypeError: Cannot read property of undefined In
JavaScript TypeError is thrown when an operand or argument passed to a function is incompatible with the type expected by that operator or...
Read more >Uncaught TypeError: Cannot read property 'value' of undefined
I have some JavaScript code that gives this error. Uncaught TypeError: Cannot read property 'value' of undefined.
Read more >[SOLVED] Cannot Read Property of Undefined in JavaScript
The “cannot read property of undefined” error occurs when you attempt to access a property or method of a variable that is undefined...
Read more >Uncaught TypeError : Cannot read properties of undefined
The root cause of the error is that the declared variable doesn't have any value, so by default, JavaScript treats all variables as...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The fix was released in 7.0.21
I am working on it 👍