ChatGPTNextWeb / ChatGPT-Next-Web

A cross-platform ChatGPT/Gemini UI (Web / PWA / Linux / Win / MacOS). 一键拥有你自己的跨平台 ChatGPT/Gemini 应用。
https://app.nextchat.dev/
MIT License
75.31k stars 58.87k forks source link

[Bug] Anthropic CORS error #5452

Open kylix31 opened 1 week ago

kylix31 commented 1 week ago

📦 Deployment Method

Official installation package

📌 Version

2.15.2

💻 Operating System

Other Linux

📌 System Version

Arch 6.10.9-zen1-2-zen

🌐 Browser

Other

📌 Browser Version

Electron

🐛 Bug Description

When I try to use any Anthropic model, I catch this error:

{
  "type": "error",
  "error": {
    "type": "authentication_error",
    "message": "CORS requests must set 'anthropic-dangerous-direct-browser-access' header"
  }
}

📷 Recurrence Steps

No response

🚦 Expected Behavior

No response

📝 Additional Information

No response

nextchat-manager[bot] commented 1 week ago

Please follow the issue template to update description of your issue.

Issues-translate-bot commented 1 week ago

Bot detected the issue body's language is not English, translate it automatically.


Title: [Bug]

QAbot-zh commented 1 week ago

更新版本测试了吗,我记得之前就有类似的帖子似乎是解决了的

https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/issues/5429

Issues-translate-bot commented 1 week ago

Bot detected the issue body's language is not English, translate it automatically.


Have you tested the updated version? I remember there was a similar post before and it seems to have solved the problem.

https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/issues/5429

Blackmesa-Canteen commented 1 week ago

Not fixed yet in MacOS APP Version 2.15.2 (20240913.094417). Error message:

{
  "type": "error",
  "error": {
    "type": "authentication_error",
    "message": "CORS requests must set 'anthropic-dangerous-direct-browser-access' header"
  }
}
sunilsoni commented 1 week ago

Anyone knows how to fix it?

lloydzhou commented 1 week ago

using tauri http API replace fetch in app,can fix CORS error

sunilsoni commented 1 week ago

using tauri http API replace fetch in app,can fix CORS error

In Mac App where can i do this settings? can you share steps or more details ?

lloydzhou commented 1 week ago

@sunilsoni

need new pull request (like here https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/blob/main/app/utils.ts#L290)

using tauriFetch instead of window.fetch, then no CORS error

andremacola commented 2 days ago

Still not fixed on 2.15.3