Minihallo
Minihallo

Reputation: 61

Failed to load resource: net::ERR_FILE_NOT_FOUND, Uncaught (in promise) TypeError: Failed to fetch

I need help. I'm using pdf-lib to load pdf doc from local disk. First I loaded the pdf with the file browser button, and fetch the url from it as below.

const existingPdfBytes = await fetch(url).then(res => res.arrayBuffer());

and the url is

"blob:http://127.0.0.1:8080/49f0cea3-8092-4a52-ad6b-f521af8ba318"

err msg

Failed to load resource: net::ERR_FILE_NOT_FOUND
Uncaught (in promise) TypeError: Fialed to fetch

This code is running in a local http-server(by npx http-server). anybody knows what the problem is?

Upvotes: 1

Views: 2957

Answers (1)

Minihallo
Minihallo

Reputation: 61

I solve it. The problem is that 'revokeObjectURL()' was called before I use the url.

Upvotes: 3

Related Questions