stellR42 / vue3-pdf-app

Vue 3 PDF viewer based on Mozilla's PDFJS
MIT License
84 stars 29 forks source link

Unnecessary warnings and errors in console #13

Closed os-tohe closed 9 months ago

os-tohe commented 1 year ago

Configuration:

Steps to reproduce the problem:

Just import and use the component like this:

<template>
  <VuePdfApp pdf="http://localhost:3000/example.pdf" style="height: 100vh" />
</template>

<script setup lang="ts">
import VuePdfApp from 'vue3-pdf-app'
</script>

What is the expected behavior?

No warnings or errors or other unnecessary logs in console.

What went wrong?

Console shows these logs:

This warning:

And this error:

Attachments (screenshots, links, etc)

image

Other information

The same logs occur if I import the pdf from ArrayBuffer. These logs are the only thing preventing us from using this package in our app.

rutup commented 1 year ago

Is there any update on this issue?

Joey-Gr commented 11 months ago

I also have the same issue. I think someone forked a tempory correction on the arguments part in the meantime here: https://github.com/stellR42/vue3-pdf-app/compare/master...chenjin01:vue3-pdf-app:master

however for the images and img (There's the loading-icon in the "img" directory, and the annotation image icons in "images" directory for some reason ).

It seems to be trying to find the images inside of your public folder, "img/loading-icon", so just putting the images in question there should work. But for me (using nuxt3), when I try to use it in a page, it will use the path of the page itself, even though it shouldn't like in a product details page, it goes "product/img/loading-icon...". So something is definitely not right there.

Edit:

it will use the path of the page itself, even though it shouldn't like in a login page, it goes "product/img/loading-icon...".

For me at least, this problem only happens if I'm at least 2 pages deep. (Like "/product/2"), if I want to show the pdf there, there is that "img" problem, and it will specifically go to "{{host}}/product/img", kind of like when you do "../img/loading-icon.svg"

stale[bot] commented 9 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Joey-Gr commented 8 months ago

Bumping this because the issue has not yet been resolved. Or if it is, it is not fully understood by the users.

I feel like this is an issue with the path using the ones in the root of the project rather than in the node_modules. I'm using Nuxt, not sure if it makes a difference here.