logancyang / obsidian-copilot

THE Copilot in Obsidian
https://www.obsidiancopilot.com/
GNU Affero General Public License v3.0
3.09k stars 219 forks source link

Error in mobile #672

Open dvl00 opened 2 months ago

dvl00 commented 2 months ago

Hi there! Thank you for your hard work on this awesome extension.

I'm getting this error on my phone: Error: Model request failed: Connection error. Cause: TypeError: Failed to execute 'fetch' on 'Window': Failed to read the 'headers' property from 'RequestInit': String contains non ISO-8859-1 code point.

Could you please advice?

logancyang commented 2 months ago

Do you have encryption on in Copilot setting? Can you try turning it off and re-enter the API key on mobile. This is going to be fixed when I upgrade the Obsidian API version. Sorry for the inconvenience!

LeCheenaX commented 2 months ago

Same error from my phone:

Error: Model request failed: Connection error. Cause: TypeError: Failed to execute 'fetch' on 'Window': Failed to read the 'headers' >property from 'RequestInit': String contains non ISO-8859-1 code point.

My desktop version works without any issues.

Solution: Thanks to @logancyang:

Do you have encryption on in Copilot setting? Can you try turning it off and re-enter the API key on mobile. This is going to be fixed when I upgrade the Obsidian API version. Sorry for the inconvenience!

The workaround is to

  1. Disable the API key encryption at the bottom of plugin setting.
  2. Re-enter the API keys you have.
  3. Save and Reload the plugin.

After doing above the plugin works on my Android :)

MTGMAD commented 1 month ago

I have this happening on my Desktop version:

Error: Model request failed: Connection error. Cause: TypeError: Failed to fetch

I am using through the open router API provider, I have removed API and model, tried entering the key only with the model I added, tried having key in both places. Nothing seems to make it work. I can not seem to get it to work with any open router AI model anymore. I have tried a few of them at this point.

UPDATE: It started to work again after I also checked the CORS box, not sure why that made it work a little beyond me, but it did.