'Selector' option throws TypeError
See original GitHub issueWith the ‘selector’ option set to true using 6.0.0, the plugin throws the following error. This occurs even without any selectors being built with calc() in my stylesheets.
TypeError: Cannot read property 'charCodeAt' of undefined
at module.exports (fakepath/node_modules/postcss-value-parser/lib/parse.js:17:21)
at new ValueParser (fakepath/node_modules/postcss-value-parser/lib/index.js:7:22)
at ValueParser (fakepath/node_modules/postcss-value-parser/lib/index.js:10:12)
at exports.default (fakepath/node_modules/postcss-calc/node_modules/reduce-css-calc/dist/index.js:29:43)
at transformValue (fakepath/node_modules/postcss-calc/dist/lib/transform.js:20:45)
at fakepath/node_modules/postcss-calc/dist/lib/transform.js:36:19
at fakepath/node_modules/postcss-selector-parser/dist/selectors/container.js:170:26
at Selector.each (fakepath/node_modules/postcss-selector-parser/dist/selectors/container.js:153:22)
at Selector.walk (fakepath/node_modules/postcss-selector-parser/dist/selectors/container.js:169:21)
at fakepath/node_modules/postcss-selector-parser/dist/selectors/container.js:173:31
Running through the gulp-postcss 7.0.0, which is using PostCSS 6.0.0
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Type error for options and style base for react-select
When I define my type for the options using a custom interface, the Select component throws a type error. I searched online for...
Read more >TypeError - JavaScript - MDN Web Docs
A TypeError may be thrown when: an operand or argument passed to a function is incompatible with the type expected by that operator...
Read more >How to Fix 'cannot set properties of null' Errors in JS - Webtips
This will throw Uncaught TypeError: Cannot set properties of null (setting 'value') const input = null input.value = 'new value'.
Read more >How to Handle JavaScript Uncaught TypeError: “x” is Not a ...
The Javascript error TypeError: "x" is not a function occurs when there is an attempt to call a function on a value or...
Read more >Resolving the JavaScript Promise Error "TypeError: Cannot ...
TypeError - Cannot read property 'then' of undefined is thrown when the caller is expecting a Promise to be returned and instead receives ......
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 FreeTop 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
Top GitHub Comments
Thank you for answer. The first option is correct fix the issue for me. But we often inevitably encounter code like below:
@mjschlot you should submit a pr and wait merged by author. 👍
The issue appears to be related to selectors like:
abbr[title]
This situation exists in packages like normalize.css (https://github.com/necolas/normalize.css/blob/master/normalize.css).Possible fix would be to test if node.value is undefined in transform.js
if (node.type === 'attribute' && node.value !== undefined) {
I’m not familiar enough with postcss to know if this is the best fix though.