Comments (10)
@FHoxhaDev Full fix is on this branch, try it out and let me know if it works for you:
"pdf2json": "github:kylerob/pdf2json#fix-createScratchCanvas-import"
It looked good in my tests.
from pdf2json.
@kylerob by pointing my "pdf2json" in package.json
will it point to your branch?
EDIT: it does resolve that issue. Thanks Kyle!
from pdf2json.
thanks to @kylerob. A more thorough fix plus appropriate tests are in PR #338, please review and test it out
from pdf2json.
Hi @modesty,
Is this an issue with Vercel or with the package itself? Is there any workaround to fix this error?
from pdf2json.
It's an issue with Vercel and executing this code on the server side due to edge functions. The issue is all of these files, the first of which you're seeing an error for, can't be read on the edge function because it hasn't been copied over by Vercel's edge function setup code. Vercel usually does a good job including what you need, but that's if you're importing code via module imports. This code is building up a string of all those file contents and eval'ing it.
I have a fork with a semi-working version that creates the big import file in a separate step, and then imports it into the main files so Vercel includes everything. I'm working on fixing an issue with a canvas function that's defined in one file and used in another that's not working, but you can try it out if you want. If I get it working today I'll create a PR in the main repo to get it merged into the baseline.
from pdf2json.
Hi @kylerob ,
Thank you for your fix. Unfortunately, for me it didn't work. It is failing at my API call where it uploads the file, this is my endpoint:
https://gist.github.com/FHoxhaDev/59e2dc2b1cc134b6d064b96573a51145
and this is the error:
Locally it works but not on Vercel host.
from pdf2json.
@FHoxhaDev Try forcing a redeploy on Vercel -- I ran into the same issue at first. Vercel seems to cache npm packages, because I've had trouble getting it to bring in my latest npm changes sometimes.
from pdf2json.
Hey @kylerob, thanks for your fix!
I just wanted to ask some quick questions.
- Any plans on making a PR with this fix at any point?
- If not, any plan to publish a separate npm package with your fork
I ask so we can install by doing a normal "pdf2json": "x.x.x" or even a "vercel-pdf2json": "x.x.x" instead of the current github thing
Cheers!
from pdf2json.
@modesty Thanks for bringing it home!
from pdf2json.
fixed in 3.1.2
from pdf2json.
Related Issues (20)
- Node.js Server got stuck when parsing specific PDF while it is working for other PDFs HOT 2
- fields with periods are truncated HOT 1
- TypeError: pdf2json_1.default is not a constructor HOT 3
- Property 'getRawTextContent' does not exist on type 'Pdfparser'.ts(2339) HOT 6
- The interface for `Line` is missing the `l` property HOT 1
- How to detect the HLines correctly?
- Without a ToUnicode CMap, PDF viewers can't map glyphs to Unicode values -> rely on pdf.js?? HOT 2
- Characters coming as NULL HOT 1
- Is the auto-merge broken text blocks capability active in the last stable version (3.0.5)? HOT 3
- Cloudflare Worker issue with Could not resolve "fs/promises" HOT 5
- something is colossaly f***** up in the exports for version 3.1.0 HOT 2
- ENOENT: no such file or directory, open '/var/task/../package.json' HOT 2
- no such file or directory - pkinfo.js HOT 1
- PDF parse, edit and retain HOT 1
- Cannot compile project with 3.1.3 HOT 5
- All PDF Parsing fails after upgrading from v3.1.2 to v3.1.3
- unexpected space HOT 7
- Parser NO SPACE - "pdf2json": "^3.1.3", HOT 1
- FATAL ERROR: JavaScript heap out of memory HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pdf2json.