I added a js package to my forge app pdfjs-parse
and now when I try to deploy I get
Error: Error thrown in the snapshot context.
App code snapshot error: Snapshot error occurred: Error: Automatic publicPath is not supported in this browser
Learn more about the snapshot context at https://go.atlassian.com/forge-snapshot-context.
Very frustrating as many packages I try seem to throw different errors
e.g.
import PDFParser from "pdf2json";
// Error: Bundling failed: export 'fileURLToPath' (imported as 'fileURLToPath') was not found in 'url' (possible exports: Url, format, parse, resolve, resolveObject), Module not found: Error: Can't resolve 'fs/promises' in '/node_modules/pdf2json', export 'fileURLToPath' (imported as 'fileURLToPath') was not found in 'url' (possible exports: Url, format, parse, resolve, resolveObject)
import pdfText from 'pdf-text';
// Error: Cannot find module 'underscore'
import {PDFExtract} from 'pdf.js-extract';
// Error: Bundling failed: Module not found: Error: Can't resolve 'canvas' in 'node_modules/pdf.js-extract/lib/pdfjs'