Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

195
Vistas
How to avoid `circular dependencies` when loading pdfAnnotate in svelte?

I would like to use pdfAnnotate in svelte, but when I start the app, npm run dev complains about Circular dependencies. I did not find any example, how to fix this error. Could anyone explain to me what I am doing wrong, or point me to a solution?

To reproduce my problem:

  # 1. install svelte-pdf
  npx degit sveltejs/template my-svelte-project
  npm install
  npm install svelte-pdf
  cp ../../example.pdf public/
  # now add to src/App.svelte see below [1]
  npm run dev
  # now the webpage <host>:5000 works fine and shows the pdf

  # 2. install pdfAnnotate 
  npm install annotpdf
  # now add it to src/App.svelte, too, see below [2].
  npm run dev
  # says "Ciruclar dependencies" and the page <host>:5000 is blank.

where I added in step [1] to src/App.svelte:

<script>
  import PdfViewer from 'svelte-pdf';
</script>
<main>
  <PdfViewer url='./example.pdf' />
</main>

and in step [2] to src/App.svelte:

<script>
  import AnnotationFactory from 'annotpdf';
</script>

(I added the lines inside the existing script and main elements, I did not use multiple such elements.)

The full error message is:

(!) Circular dependencies
node_modules/annotpdf/lib/object-util.js -> node_modules/annotpdf/lib/array-util.js -> node_modules/annotpdf/lib/object-util.js
node_modules/annotpdf/lib/object-util.js -> node_modules/annotpdf/lib/array-util.js -> /home/lst/tmp/pdf/pdfjs-svelte-app/node_modules/annotpdf/lib/object-util.js?commonjs-proxy -> node_modules/annotpdf/lib/object-util.js
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda