我有一条快速路线,其中包含以下内容:
let result = await fetch("http://someurl");
result = await result.blob();
console.log(result)
const img = URL.createObjectURL(result);
Run Code Online (Sandbox Code Playgroud)
这会产生以下错误(第 4 行):
TypeError: The "obj" argument must be an instance of Blob. Received an instance of Blob
这里发生了什么?
如果有帮助,console.log 的结果是:
Blob {
[Symbol(type)]: 'image/png',
[Symbol(buffer)]: <Buffer 89 50 4e ... 481501 more bytes>
}
Run Code Online (Sandbox Code Playgroud)
并且获取路由转到另一个调用的 Express 应用程序res.sendFile(myfilepath)