TaTo30 / vue-pdf

PDF component for Vue 3
https://tato30.github.io/vue-pdf/
MIT License
472 stars 65 forks source link

Cannot set properties of undefined (setting 'workerSrc') #108

Closed YaoZhouZ closed 4 months ago

YaoZhouZ commented 6 months ago

File: /Users/edy/Desktop/project/lightpdf/node_modules/.pnpm/@tato30+vue-pdf@1.9.6_vue@3.4.20/node_modules/@tato30/vue-pdf/dist/index.mjs:741:35 Code: 740 | function vl(l) {

741 | D.GlobalWorkerOptions.workerSrc = l; | ^ 742 | } 743 | function fl(l, d = { 744 | onProgress: void 0, Stacktrace:

TaTo30 commented 6 months ago

That error is common when SSR frameworks are used, Try wrapping the component with some "client-only" component or directive.

YaoZhouZ commented 6 months ago

I used astro for development and I used the instructions for client rendering image But the error remains unresolved image

YaoZhouZ commented 6 months ago

image

TaTo30 commented 6 months ago

I have not used astro but after some research I found this:

imagen