Skip to content

ditch cjs / umd and only use esm #100

@jimmywarting

Description

@jimmywarting

the problem is clear:

invoices.html:377 Error: No "GlobalWorkerOptions.workerSrc" specified.
at PDFParse.load (PDFParse.ts:186:25)
at PDFParse.getText (PDFParse.ts:155:26)
at parsePdf (invoices.html:289:35)
at handleFile (invoices.html:368:32)

this can easily be resolved by using import.meta.resolve to resolve the path relative to itself.
devs should not have to care about this things.

new Worker(import.meta.resolve('./worker.js'))

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