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

[BUG] transitionDuration in CSSParsedDecleration is parsing incorrectly #2655

Closed
2 tasks done
DanielBelmes opened this issue Aug 13, 2021 · 2 comments · Fixed by #2657
Closed
2 tasks done

[BUG] transitionDuration in CSSParsedDecleration is parsing incorrectly #2655

DanielBelmes opened this issue Aug 13, 2021 · 2 comments · Fixed by #2657

Comments

@DanielBelmes
Copy link

Please make sure you are testing with the latest release of html2canvas.
Old versions are not supported and issues reported for them will be closed.

Please follow the general troubleshooting steps first:

  • You are using the latest version
  • You are testing using the non-minified version of html2canvas and checked any potential issues reported in the console

Bug reports:

I'm exporting a canvas of Kibana and it is failing when parsing the style
CSSParsedDeclaration.transitionDuration = "0.15s, 0.15s, 0.15s, 0.15s" Tokens parsed out too.

[
    {
        "type": 15,
        "number": 0.15,
        "flags": 8,
        "unit": "s"
    },
    {
        "type": 4
    },
    {
        "type": 31
    },
    {
        "type": 15,
        "number": 0.15,
        "flags": 8,
        "unit": "s"
    },
    {
        "type": 4
    },
    {
        "type": 31
    },
    {
        "type": 15,
        "number": 0.15,
        "flags": 8,
        "unit": "s"
    },
    {
        "type": 4
    },
    {
        "type": 31
    },
    {
        "type": 15,
        "number": 0.15,
        "flags": 8,
        "unit": "s"
    }
]

When it reaches parseComponentValue it triggers throw new SyntaxError(Error parsing CSS component value, multiple values found when expecting only one); Because of {type: 4}.

PR that caused this #2632

Specifications:

  • html2canvas version tested with: 1.3.0
  • Browser & version: Chrome 91.0.4472.114
  • Operating system: Mac Os Catalina
@AgentSmith0
Copy link

I can confirm this issue. I have the same problem.

@niklasvh
Copy link
Owner

Thanks for the report, should be fixed with 1.3.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants