Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promise.withResolvers is not a function #25

Closed
jimmyland22 opened this issue Apr 17, 2024 · 3 comments
Closed

Promise.withResolvers is not a function #25

jimmyland22 opened this issue Apr 17, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@jimmyland22
Copy link

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
Copy link

mkska commented Apr 21, 2024

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: mozilla/pdf.js#17932

@sinedied sinedied added the bug Something isn't working label Apr 30, 2024
@fedgalnebu
Copy link

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
Copy link
Collaborator

sinedied commented Jul 2, 2024

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

@sinedied sinedied closed this as completed Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants