-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Error: Attempting to parse an unsupported color function "color" #2700
Comments
This is also true for other new color functions from CSS Color Module Level 4 which now have wide browser support like oklab and oklch. Note that even if there is a non oklch fallback color, html2canvas still errors if it sees un unsupported color function |
use https://www.npmjs.com/package/html2canvas-pro, it works! If you found this helpful, don't forget to leave a star 🌟. |
I got the same error today utill it works in chrome traceless mode. when I turn off the browser extensions named "ModHeader", it works |
I'm getting below error when I try to use html2canvas and daisyUI Error: Attempting to parse an unsupported color function "oklch" daisyUI 4.10.5 |
@yorickshan it doesn't unfortunately |
Did you manage to solve it? I'm having the same issue. I'm not even using html2canvas directly, just jspdf.html (which uses html2canvas) |
Getting the same error, while attempting to convert a next js page styled with tailwind into a PDF. |
Feel free to try using html2canvas-pro v1.5.5 or the most recent version. |
Getting the same error with an MUI-Joy based website when trying to use jsPDF's Any workaround which would allow me to ignore these errors and still parse the rest? I wouldn't mind some specific colors being off as long as the function call doesn't crash. |
i updated to html2canvas-pro and i was able to generate pdf without issue. then import html2canvas from html2canvas-pro and that is all. |
can you please clarify more on when to import html2canvas-pro. btw, im using jsPdf library and i get this error |
Same struggle here, I wrote an issue, since jsPDF uses html2canvas under the hood and there is no documented way of forcing it to switch to html2canvas-pro. |
This works perfectly |
If you found this helpful, don't forget to leave a star 🌟. |
I took a good look at this issue some days back and while @yorickshan fix mutes the error the screenshot comes out very broken on tailwind driven site and some other conditions. my application primarily needed to be so flexible you can take a screenshot on almost any site. so i needed a robust fix with the most stable html2canvas version. now i don't advice installing another html2canvas package if html2canvas-pro works, but i merged a number of fix from myself, @yorickshan (object-fit) and @nidi3 (textarea issue). and you can install it here to fix all your problems |
feel free to submit PR to https://github.com/yorickshan/html2canvas-pro. |
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:
Bug reports:
Parsing elements with the
color()
function fails in Safari.In Safari (14 and 15 tested), see the canvas is not rendered, and the error
Error: Attempting to parse an unsupported color function "color"
is printed to console:https://jsfiddle.net/g1vxbwso/
Specifications:
The text was updated successfully, but these errors were encountered: