Azure-Samples / azure-openai-rag-workshop

Create your own ChatGPT with Retrieval-Augmented-Generation workshop
https://aka.ms/ws/openai-rag
MIT License
97 stars 349 forks source link

Promise.withResolvers is not a function #25

Closed jimmyland22 closed 4 months ago

jimmyland22 commented 7 months ago

Getting stuck in the ingestion step with the following error:

@jimmyland22 ➜ /workspaces/azure-openai-rag-workshop (main) $ ./scripts/ingest-data.sh Loading azd .env file from current environment Installing dependencies and building CLI

up to date, audited 699 packages in 2s

155 packages are looking for funding run npm fund for details

found 0 vulnerabilities

ingestion@1.0.0 build tsc

Running "ingest-files" CLI tool Ingesting 3 file(s)... Ingesting file "./data/privacy-policy.pdf"... Error ingesting files: Error ingesting file "./data/privacy-policy.pdf": Unknown server error: Promise.withResolvers is not a function

mkska commented 6 months ago

What helped for me is to pin pdf-js package. Latest version of Pdf-js is already using Promise.withResolver(), which hasn't been properly introduced in node.js v20. Using previous version of pdf-js solves the issue. You may pin it by: npm install pdfjs-dist@4.0.379 --workspace=ingestion. Reference: https://github.com/mozilla/pdf.js/issues/17932

fedgalnebu commented 6 months ago

Run into the same situation as @jimmyland22 but pinning the pdf-js version didn't help(tried various pdf-js versions, all with same output):

ingestion@1.0.0 build tsc

Running "ingest-files" CLI tool Ingesting 13 file(s)... Ingesting file "./data/xxxxxxxxxxxxxxxxxxxx.pdf"... Error ingesting files: Error ingesting file "./data/Bxxxxxxxxxxxxxxxxxxxxx.pdf": Unknown server error: Promise.withResolvers is not a function

npm list pdfjs-dist azure-openai-rag-workshop@1.0.0 /workspaces/azure-openai-rag-workshop └─┬ ingestion@1.0.0 -> ./src/ingestion └── pdfjs-dist@4.0.189

sinedied commented 4 months ago

The ingestion service has been rewritten entirely, so this issue should not occur anymore. Thanks for reporting