question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

7.0.3 regression: exception while parsing source with postcss-safe-parser

See original GitHub issue

We are using postcss alongside postcss-safe-parser in stylable, and use that infrastructure in stylable-intelligence

since the recently released postcss@7.0.3, I see the following crash in multiple tests of stylable-intelligence:

TypeError: Cannot read property '0' of undefined
      at SafeParser.colon (node_modules/postcss/lib/parser.es6:460:17)
      at SafeParser.colon [as precheckMissedSemicolon] (node_modules/postcss-safe-parser/lib/safe-parser.es6:53:24)
      at SafeParser.precheckMissedSemicolon [as decl] (node_modules/postcss/lib/parser.es6:206:10)
      at SafeParser.decl (node_modules/postcss-safe-parser/lib/safe-parser.es6:32:7)
      at SafeParser.decl [as other] (node_modules/postcss/lib/parser.es6:140:12)
      at SafeParser.other (node_modules/postcss/lib/parser.es6:56:16)
      at parse (node_modules/postcss-safe-parser/lib/safe-parse.es6:9:10)
      at Object.safeParse (node_modules/@stylable/core/src/parser.ts:15:12)
      at /home/avi/projects/stylable-intelligence/node_modules/@stylable/core/src/create-infra-structure.ts:34:28
      at processContent (node_modules/@stylable/core/src/cached-process-file.ts:51:12)
      at Object.process (node_modules/@stylable/core/src/cached-process-file.ts:41:27)
      at Stylable.process (node_modules/@stylable/core/src/stylable.ts:112:35)
      at files.forEach.file (src/lib/provider.ts:807:38)
      at Array.forEach (<anonymous>)
      at newFindRefs (src/lib/provider.ts:806:15)
      at Object.getRefs (src/lib/provider.ts:917:12)
      at Object.getReferences (test-kit/asserters.ts:63:12)
      at Context.<anonymous> (test/lib/references.spec.ts:61:26)

(the above is caught with source-map-support, so source locations are provided) v7.0.2 worked properly

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
AviVahlcommented, Sep 27, 2018

Super quick! I’ll verify it fixes the issue on my end and reply back here. Thanks!

1reaction
aicommented, Sep 27, 2018

@AviVahl @janczer fixed 20f80a8

Read more comments on GitHub >

github_iconTop Results From Across the Web

[8.0.4] parse throws while using postcss-safe-parser #1411
There's a new regression with 8.0.4 when (postcss-safe-)parsing the following: :import { -st-from: "b/index.st.css" -st-default: B; } ...
Read more >
postcss-safe-parser | Yarn - Package Manager
A fault-tolerant CSS parser for PostCSS, which will find & fix syntax errors, capable of parsing any input. It is useful for: Parse...
Read more >
You tried to parse SCSS with the standard CSS parser
What it's doing is actually looking at your index.html file and inspecting stylesheet entries, then trying to include them in the source.
Read more >
Dependencies | hlp | npm - Open Source Insights
arrow_right @babel/cli. 7.19.3 Notes Relation Licenses Dependencies 37 Version 7.19.3 Published Description arrow_right @babel/core. 7.20.5 Notes Relation Licenses Dependencies 51 Version 7.20.5 Published Description
Read more >
CHANGELOG.md | postcss@8.4.16 - Deno
8.4.15. Fixed AST normalization after using custom parser with old PostCSS AST. ... Fixed ReDoS vulnerabilities in source map parsing (by Yeting Li)....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found