Skip to content

on dev its showing fake worker #2061

@pankajsparihar

Description

@pankajsparihar

Before you start - checklist

  • I followed instructions in documentation written for my React-PDF version
  • I have checked if this bug is not already reported
  • I have checked if an issue is not listed in Known issues
  • If I have a problem with PDF rendering, I checked if my PDF renders properly in PDF.js demo

Description

console error
installHook.js:1 Warning: Setting up fake worker.

overrideMethod
@
installHook.js:1

F
@
pdfjs-dist-3cGUoCSg.js:1

#u
@
pdfjs-dist-3cGUoCSg.js:2

i
@
pdfjs-dist-3cGUoCSg.js:2

e.addEventListener.signal
@
pdfjs-dist-3cGUoCSg.js:2

in main.tsx file

pdfjs.GlobalWorkerOptions.workerSrc = new URL(
'pdfjs-dist/build/pdf.worker.min.mjs',
import.meta.url,
).toString();

Steps to reproduce

we are using react-pdf with .tsx file , in local environment its working fine, but after deployment its showing fake worker console warning and not loading the pdf

Expected behavior

its should load pdf

Actual behavior

not loading

Additional information

No response

Environment

  • Browser (if applicable):
  • React-PDF version: 10.2.0
  • React version:18.3.3
  • Bundler name and version (if applicable):vite

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions