Unsupported Color Function 'oklab' Error in html2canvas

Issue

I’m using html2canvas version 1.4.0, but I’m encountering an issue where the canvas fails to render properly. The following error is displayed:

Error: Attempting to parse an unsupported color function "oklab"

It seems that the oklab color function is not working. How can I resolve this issue?

Solution

Unfortunately, the oklab color function is not supported in the latest version of the html2canvas library.

To fix this issue, consider using html2canvas-pro. This library is a fork of html2canvas and maintains the same API while adding support for modern color functions such as color, lab, lch, oklab, and oklch.