nuxt-pdf icon indicating copy to clipboard operation
nuxt-pdf copied to clipboard

Exporting PDF using DaisyUI

Open hylink-carlos-nieto opened this issue 1 year ago • 4 comments

Environment

No response

Reproduction

No response

Describe the bug

I'm trying to export a pdf using this module in a project with DaisyUI, but I'm getting the attached error. Apparently it doesn't load correctly the oklch variables from Daisy. Thank you in advance if someone can help me with this.

Screenshot 2024-01-31 at 6 18 32 PM

Additional context

No response

Logs

No response

hylink-carlos-nieto avatar Jan 31 '24 23:01 hylink-carlos-nieto

Hello, I have the same bug,

Error: Attempting to parse an unsupported color function "oklch" at Object.parse (html2canvas.esm.js?v=57a7160c:1720:23)

I had no idea it was related to DaisyUI but yes, I also use DaisyUI. Any potential solution for this?

Thanks!

frantortosa avatar Apr 12 '24 09:04 frantortosa

i have same problem

Uncaught (in promise) Error: Attempting to parse an unsupported color function "oklch"

any update?

ichsanmln99 avatar May 14 '24 05:05 ichsanmln99

This seems to be a limitation of the underlying html2canvas library (used by jspdf, which nuxt-pdf uses), there's several issues (https://github.com/niklasvh/html2canvas/issues/3130, https://github.com/niklasvh/html2canvas/issues/3150, https://github.com/niklasvh/html2canvas/issues/2700) mentioning it but the library seems to be unmaintained for the last 2 years.

Each issue has a comment from the author of a fork https://www.npmjs.com/package/html2canvas-pro saying theirs supports oklch, but the fork's git repo only has 2 commits (so the oklch support has been blended into its 'initial commit') which doesn't bode well for longterm success of that fork. Theres another fork that looks to be more open source friendly, but at a glance it doesn't look like it supports oklch yet.

I'm unsure how this package might do much about this, but I'm personally going to look into using Puppeteer for serverside pdf generation instead.

Nebual avatar May 24 '24 01:05 Nebual