Error: Attempting to parse an unsupported color function "oklab"。html2canvas报错

情况

大致是下面这样的。

Error: Attempting to parse an unsupported color function "oklab" at Object.parse (html2canvas.js:1726:1) at parse (html2canvas.js:3750:1) at new CSSParsedDeclaration (html2canvas.js:3627:1) at new ElementContainer (html2canvas.js:3796:1) at createContainer (html2canvas.js:4793:1) at parseNodeTree (html2canvas.js:4739:1) at parseTree (html2canvas.js:4798:1) at html2canvas.js:7783:1 at step (html2canvas.js:86:1) at Object.next (html2canvas.js:67:1)

解决

https://github.com/parallax/jsPDF/issues/3748
卸载html2canvas,安装html2canvas-pro这个库。

import html2canvas from 'html2canvas-pro';

似乎没什么兼容性问题。

posted @ 2025-08-02 03:08  魂祈梦  阅读(104)  评论(0)    收藏  举报