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

Error when using with vite production build #2678

Closed
smitbhalodiya opened this issue Jan 17, 2024 · 3 comments
Closed

Error when using with vite production build #2678

smitbhalodiya opened this issue Jan 17, 2024 · 3 comments

Comments

@smitbhalodiya
Copy link

smitbhalodiya commented Jan 17, 2024

When using in a Laravel with Vite.

  • Laravel: v10.39.0
  • Vite: v5.0.11
  • pdfmake : v0.2.9

I am importing the library like this:

import pdfFonts from 'pdfmake/build/vfs_fonts';
pdfMake.vfs = pdfFonts.pdfMake.vfs;

image

This code works fine when running with vite watch

I am importing the library like this:
import * as pdfFonts from 'pdfmake/build/vfs_fonts';

It successfully ran the Yarn Build command without encountering any build errors, but see errors in the console.
image

@SamirMishra27
Copy link

SamirMishra27 commented Feb 9, 2024

Hi, have you found a solution to this? I'm also facing same exact issue in production deployment of site, using react and vite as build tool.

Edit: found potential solutions in #2654

@smitbhalodiya
Copy link
Author

Hi @SamirMishra27,
Everything worked out!, thank you very much!

@du-disk
Copy link

du-disk commented Jul 17, 2024

Hi @SamirMishra27, Everything worked out!, thank you very much!

How?

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

No branches or pull requests

4 participants