At Stylable, we use postcss together with postcss-safe-parser.
When upgrading to v8, the following at-rule:
@custom-selector :--pongo div span Comp:
Started throwing the following:
TypeError: Cannot read property 'line' of null
at SafeParser.atrule (/home/avi/projects/stylable/node_modules/postcss/lib/parser.js:362:21)
at SafeParser.parse (/home/avi/projects/stylable/node_modules/postcss/lib/parser.js:51:16)
at Object.safeParse [as default] (/home/avi/projects/stylable/node_modules/postcss-safe-parser/lib/safe-parse.js:9:10)
at Object.safeParse (/home/avi/projects/stylable/packages/core/src/parser.ts:14:22)
I realize the syntax is broken... we're using postcss-safe-parser so we can provide completions.
Exception can be reproduced in the Node REPL as well using just postcss:
[avi@localhost stylable]$ node
Welcome to Node.js v14.11.0.
Type ".help" for more information.
> require('postcss-safe-parser')('@custom-selector :--pongo div span Comp:')
Uncaught TypeError: Cannot read property 'line' of null
at SafeParser.atrule (/home/avi/projects/stylable/node_modules/postcss/lib/parser.js:362:21)
at SafeParser.parse (/home/avi/projects/stylable/node_modules/postcss/lib/parser.js:51:16)
at safeParse (/home/avi/projects/stylable/node_modules/postcss-safe-parser/lib/safe-parse.js:9:10)
>
Yeap. postcss-safe-parser should process anything.
I will fix it tomorrow.
The fix was released in 8.0.4
Most helpful comment
Yeap.
postcss-safe-parsershould process anything.I will fix it tomorrow.