小编kez*_*ezh的帖子

createObjectURL 错误:`参数必须是 Blob 的实例。收到 Blob 的实例`

我有一条快速路线,其中包含以下内容:

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)

file fetch node.js express

7
推荐指数
1
解决办法
4493
查看次数

标签 统计

express ×1

fetch ×1

file ×1

node.js ×1