Issue "Attempting to parse an unsupported color function "oklch"
This error occurs when i am using html2pdf lib ver 0.10.2 to convert html content into a pdf file (Chrome 131.0.6778.205 and Edge). Please give me a solution, thanks you!
look it https://github.com/niklasvh/html2canvas/issues/2700
The same :(
This error occurs when i am using html2pdf lib ver 0.10.2 to convert html content into a pdf file (Chrome 131.0.6778.205 and Edge). Please give me a solution, thanks you!
![]()
Look into 👉 https://github.com/niklasvh/html2canvas/issues/2700#issuecomment-2781596537
To add to @027xiguapi and @SwapnilBhattacharya05 comments, here's a summary of how I addressed this in a project setup with Quasar/Vite:
-
Removed
html2canvasand addedhtml2canvas-pro -
Added a custom alias to ensure
html2pdf.jsimports fromhtml2canvas-proinstead ofhtml2canvas:
// quasar.config.ts
extendViteConf(viteConf) {
// ...
viteConf.resolve = viteConf.resolve || {}
viteConf.resolve.alias = {
...viteConf.resolve.alias,
html2canvas: resolve(import.meta.dirname, 'node_modules/html2canvas-pro'),
}
// ...
}
i handle this issue with this steps
- using
html2canvas-proto convert the element into image - use
pdfjsto convert it into pdf after take it fromhtml2canvas-pro
and the result so good