Closed probert94 closed 1 year ago
PDF.js a such is not fully, compatible with vite: see https://github.com/mozilla/pdf.js/issues/10317#issuecomment-1112675400
However workaround may exists to import the worked differently https://erindoyle.dev/using-pdfjs-with-vite/
Meanwhile, there is webpack fallback option in Vaadin 23, which allows to use the add-on in the current form.
I forgot to mention, that we are already using Vaadin 23.2 with vite, so its not (only) a vite issue. I think it might be related to a stricter typescript validation in vaadin 23.3, as we got a lot of typescript related errors when trying to update.
Fix has been released in version 2.5.3
I tried upgrading my project from Vaadin 23.2 to 23.3. Unfortunately I get the following error:
SyntaxError: The requested module '/VAADIN/generated/jar-resources/print-js/dist/print.js' does not provide an export named 'default'
The issue can be reproduced with a Vaadin starter: 1) Add vcf-pdf-viewer 2.5.2 as a dependency. 2) Add the following code to
MainView.java
:It seems like there is a problem with pdf-js and vite but we are already using Vaadin 23.2 with vite so the issue is not related to vite only.