erictik / midjourney-api

MidJourney client. Unofficial Node.js client
Apache License 2.0
1.69k stars 283 forks source link

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

Open SkylarShuang opened 8 months ago

SkylarShuang commented 8 months ago

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 commented 8 months ago

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