midjourney-api icon indicating copy to clipboard operation
midjourney-api copied to clipboard

Uncaught (in promise) TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation

Open SkylarShuang opened this issue 1 year ago • 1 comments
trafficstars

the code that reproduces this issue or a replay of the bug

const response = await this.config.fetch(url, { headers: { authorization: this.config.SalaiToken }, });

Describe the bug

Describe the bug new Midjourney 遇到报错

具体报错在 const response = await this.config.fetch(url, { headers: { authorization: this.config.SalaiToken }, });

查阅资料发现应该是authorization里面有特殊字符导致fetch失败,有大神指导怎么解决吗

error log

const response = await this.config.fetch(url, { headers: { authorization: this.config.SalaiToken }, });

SkylarShuang avatar Jan 22 '24 13:01 SkylarShuang

解决了,自定义插件方法即可 fetch: window.fetch.bind(window)

SkylarShuang avatar Jan 23 '24 03:01 SkylarShuang