Skip to content

Worker connections #2037

@ayuka-bg

Description

@ayuka-bg

Before you start - checklist

  • I understand that React-PDF does not aim to be a fully-fledged PDF viewer and is only a tool to make one
  • I have checked if this feature request is not already reported

Description

I guess it should be documented somewhere about worker
i don't know if it broke somewhere somehow, but i'm fine with this solution

  useEffect(() => {
    (async () => {
      // Configure the worker source
      // eslint-disable-next-line @typescript-eslint/ban-ts-comment
      //@ts-expect-error
      await import('pdfjs-dist/build/pdf.worker.mjs');

      setWorkerLoaded(true);
    })();
  }, []);

Proposed solution

No response

Alternatives

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions