Code Monkey home page Code Monkey logo

Comments (4)

Fiattarone avatar Fiattarone commented on May 30, 2024 1

Hey there, sorry for taking so long!

https://github.com/Fiattarone/unpdf-plasmo-example under core/test.ts is where I put it

Or, even easier to reproduce with a one-liner:

git clone [email protected]:Fiattarone/unpdf-plasmo-example.git  --recurse-submodules &&
cd unpdf-plasmo-example &&
pnpm install &&
pnpm dev

fails upon compiling

If this is more of an issue with plasmo, I'll take it up with them--just let me know!

from unpdf.

johannschopplich avatar johannschopplich commented on May 30, 2024

Mmh, interesting. Which bundler does Plasmo use? unpdf provides a sub path export unpdf/pdfjs:

"./pdfjs": {

Seems to me more like a Plasmo issue than unpdf. I have tested unpdf with esbuild, Rollup and more, which all correctly bundle unpdf/pdfjs.

Could you please provide a reproducible example?

from unpdf.

Fiattarone avatar Fiattarone commented on May 30, 2024

Bundler used is https://parceljs.org/ I believe... I know that I couldn't get plasmo to work with pdfjs either, so this very well could be a plasmo issue.

Will drop an example in here when I get a moment, sorry about not including that the first round.

My current workaround is to use unpdf on my proxy (vercel) server (normally used for other things) but this is really just to continue development, it would be really not-prime to handle everyone's PDF shenanigans when they could be doing it themselves on the client side.

from unpdf.

johannschopplich avatar johannschopplich commented on May 30, 2024

Hi @Fiattarone, thanks for the reproduction. I tried to import the pdfjs subpath export, but somehow the Parcel bundler doesn't seem to resolve the dependency. A quick look at Parcel's dependency resolution docs didn't help.

Even if we point to the PDF.js source file, the bundler fails to locate it:

import { configureUnPDF, extractText } from "unpdf"

configureUnPDF({
  pdfjs: () => import("unpdf/dist/pdfjs.mjs"),
});

Sorry, but at the moment, I don't have a fix for the Plasmo framework. Noted that Vite (using Rollup) and esbuild correctly resolves the import…

from unpdf.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.