Skip to content
This repository was archived by the owner on Mar 25, 2026. It is now read-only.
This repository was archived by the owner on Mar 25, 2026. It is now read-only.

Doesn't work with next js 14 #52

@Andmarecoenergy

Description

@Andmarecoenergy

Module not found: Can't resolve 'pdfjs-dist/build/pdf.worker.mjs'
81 | // We import this here so that it's only loaded during client-side rendering.
82 | const pdfJS = await import("pdfjs-dist");

83 | pdfJS.GlobalWorkerOptions.workerSrc = require("pdfjs-dist/build/pdf.worker.mjs");
| ^
84 | const pdf = await pdfJS.getDocument(templateBytes).promise;
85 |
86 | setTotalPages(pdf.numPages);

https://nextjs.org/docs/messages/module-not-found

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions