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.

parse fails when parsing style tag

See original GitHub issue

We’ve got an svg that looks kind of like this:

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  <defs>
    <style>
      .clipped-thing {
        clip-path: url(#clip-path);
      }  
    </style>
    <clipPath id="clip-path">
      <rect y="-0.86" width="375" height="177"/>
    </clipPath>
  </defs>
  <g class="clipped-thing">
    <!-- SOME SVG STUFF -->
  </g>
</svg>

loading this svg fails with: Module build failed: SyntaxError: unknown: Unexpected token on clip-path: url(#clip-path);

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:8
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
boopathicommented, Aug 8, 2016
0reactions
seleckiscommented, Aug 9, 2016

Oh, sorry, I have used webpack 2.x config instead of webpack 1.x. Now everything works properly. So for this issue I suggest to use svgo config with removeStyleElement: true

Read more comments on GitHub >

github_iconTop Results From Across the Web

Common CSS Parser Errors (Parsing Errors Found)
The parser will show a Parse Error and the line number if it detects something that does not meet the requirements. CSS Parser...
Read more >
How to fix: CSS: Parse Error. - Rocket Validator
CSS styles could not be parsed, check the indicated line to find what caused the parser to fail. Common causes are unclosed curly...
Read more >
JSON.parse throws error when parsing JSON that has HTML ...
I have the following code that I'm trying to use and I keep getting an error on the JSON parser
Read more >
CSS Parse Error: The Ultimate Guide To Eradicating Them
Parse error in CSS occurs when a style sheet departs from the precise CSS parser requirements; Common causes include missing a semicolon, curly...
Read more >
13.2 Parsing HTML documents - HTML Standard - WhatWG
This error occurs if the parser encounters a start tag for an element that is not in the list of void elements or...
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