Rosson Long - One of our experiences with Build...
One of our experiences with BuildShip that seems to be true so far is that you can't import common libraries like this:
import { PDFDocument } from "pdf-lib";
Knowing that you can't import libraries like this, how would you build workflows that manage and interact with PDFs like for example, merging multiple PDFs together into a single PDF at the end of a workflow?
Or maybe imports are possible. We just haven't had any success with them and we've been building for awhile.
4 Replies
@Gaurav Chadha
@Rosson Long named imports works in BuildShip, the only issue with
import { PDFDocument } from "pdf-lib";
is that this particular library requires extra dependencies as worker which isn't working.
you can use any other pdf parser libraries (which are browser supported), example, I used this for same operaton import pdf from '@cyber2024/pdf-parse-fixed';
and it worked flawlessly. https://app.buildship.com/remix/4318f78f-5105-4432-95ab-caf2aec89b7e
Is there a good way to know whether or not an import has dependency workers without a basic trial-and-error approach?
Thank you btw, this is a great starting point to solve the problem!!
The best approach is to build the node with the AI Builder, which will always use or update the node with the supported library.
happy to help :)