Skip to content
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

bug: html2canvas issue #2827

Closed
semiautomatix opened this issue Feb 6, 2024 · 4 comments
Closed

bug: html2canvas issue #2827

semiautomatix opened this issue Feb 6, 2024 · 4 comments

Comments

@semiautomatix
Copy link

What version of daisyUI are you using?

v4.6.1

Which browsers are you seeing the problem on?

Edge

Reproduction URL

https://www.npmjs.com/package/jspdf

Describe your issue

Attempting to implement the most basic example on any DaisyUI HTMLElement will result in the following browser error:

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

Example code:

export const printCard = (el?: HTMLElement | null) => {
  if (el) {
    // Default export is a4 paper, portrait, using millimeters for units
    const doc = new jsPDF();

    doc.text("Hello world!", 10, 10);
    doc.html(el, {
      callback: function (doc) {
        doc.save("sample.pdf");
      },
    });
  }
};

Further referenced in html2canvas repository where it's indicated this error is caused by using any version of DaisyUI 4+: niklasvh/html2canvas#3130

Copy link

github-actions bot commented Feb 6, 2024

Thank you @semiautomatix for reporting issues. It helps daisyUI a lot 💚
I'll be working on issues one by one. I will help with this one as soon as a I find a solution.
In the meantime providing more details and reproduction links would be helpful.

@semiautomatix
Copy link
Author

Prior issue appears to have been closed: niklasvh/html2canvas#2700

@saadeghi
Copy link
Owner

saadeghi commented Feb 6, 2024

There's nothing I can do on my end. we should wait for html2canvas update to support new colors.
You can still use daisyUI version 3.x which uses older HSL color model.

@saadeghi saadeghi closed this as completed Feb 6, 2024
@semiautomatix
Copy link
Author

There's nothing I can do on my end. we should wait for html2canvas update to support new colors. You can still use daisyUI version 3.x which uses older HSL color model.

I appreciate the swift reply. Let's leave the closed issue here, so anyone in a similar situation will understand where the issue exists and what can be done until html2canvas is updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants