Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'value' of undefined #1305

Open
StephenEsser opened this issue Oct 25, 2019 · 8 comments
Open

TypeError: Cannot read property 'value' of undefined #1305

StephenEsser opened this issue Oct 25, 2019 · 8 comments
Labels
Milestone

Comments

@StephenEsser
Copy link

@StephenEsser StephenEsser commented Oct 25, 2019

Issue

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)

  1. git clone https://github.com/cerner/terra-core.git
  2. cd terra-core
  3. npm install
  4. npm start
  5. Observe the stack trace above
@ai
Copy link
Member

@ai ai commented Oct 25, 2019

I am working on it 👍

@ai
Copy link
Member

@ai ai commented Oct 25, 2019

Sorry, I can’t run npm install on your project.

Can you reduce the case for the simple project with less dependencies?

@ai
Copy link
Member

@ai ai commented Oct 25, 2019

I found the problem. But it will be hard to fix it quickly.

@ai
Copy link
Member

@ai ai commented Oct 25, 2019

I reported issue TrySound/postcss-value-parser#60

@ai
Copy link
Member

@ai ai commented Oct 25, 2019

I reverted PostCSS 7.0.19 feature b8ce024

There is no way to fix. I will move it to next major 8.0 release.

@emilyrohrbough
Copy link

@emilyrohrbough emilyrohrbough commented Oct 25, 2019

Thank you for being so responsive!!

@ai
Copy link
Member

@ai ai commented Oct 25, 2019

The fix was released in 7.0.21

@shellscape
Copy link
Contributor

@shellscape shellscape commented Feb 11, 2020

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)
@ai ai closed this Mar 28, 2020
@ai ai reopened this Mar 28, 2020
@ai ai added the enhancement label Mar 28, 2020
@ai ai added this to the 8.0 milestone Mar 28, 2020
@ai ai added docs and removed enhancement labels Mar 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.