-
Notifications
You must be signed in to change notification settings - Fork 52
need some help :) #30
Comments
Ok. Here's the repo.
or instead of yarn The only things I added was a wasm plugin in
Much appreciated if you can help me figure this out! |
Did you have a look at wasm-pdf-app? Unfortunately I have no experience integrating this with Vite or other build processes. |
I did. The first implementation was based on that. Dunno, but maybe a minimum thing would be to hoist the error in the "finally"-block upwards? :) Thanks again. Cheers! |
hey, I have implemented wasm-pdf in angular. my angular repo 👇 |
Hi!
Awesome package! But, I need some help to get it working in my vite, react app.
First off, running the example app works great! So far so good.
However, when I try to implement it i my app, stuff gets tricky. I tried to call the
run
-function in multiple ways, but no success so far.I tried importing the module in my .jsx files and running the function, but no luck. To fault trace, I decided to copy the example app as far as possible. This led me to get an error that might make sense to you.
I'm running a simple vite react-ts project, installed using pnpm, following these instructions: https://vitejs.dev/guide/#scaffolding-your-first-vite-project
pnpm create vite my-vue-app -- --template react-ts
This is one of the ways I tried to implement
wasm-pdf
:index.js
,bootstrap.js
, to a folder/src/PDF/
, and update all the paths accordingly.bootstrap.js
, because I can't be bothered adding the test-file to vite config, etc. ^^bootstrap.js
now looks like this:index.html
, like so:Now comes the fun part. The console error message:
Cool! I'm actually reaching the
run
-function! But something's wrong and I can't figure it out.Telling firefox to break on exception gives me this:
Dunno if it's useful information but if I let it run and stop it at line 140 I get this
And
I'm guessing the first way I tried to implement it didn't work because of the same reason. However, I couldn't get any useful information from that. Just an empty error message:
Here's that first, preferred implementation:
Any help on how to fix this would be greatly appreciated.
I'll try to set up a repo to reproduce it.
The text was updated successfully, but these errors were encountered: