-
-
Notifications
You must be signed in to change notification settings - Fork 11.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Vercel 上部署的服务端数据库版web页面中的缩略图不显示,报跨域CORS错误 #5480
Comments
Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible. |
Hey @Ryaningli! 👋 I'm here to help you with your bug report. Let's squash this bug together! I found a similar unsolved discussion regarding a file upload error with Cloudflare R2 storage [1]. Additionally, there is a closed issue related to a 403 error caused by an unallowed referer, but no solution was found in the comments [2]. To resolve the CORS error you're experiencing with the Vercel-deployed web page, you need to configure the CORS settings in your Cloudflare R2 storage bucket. The error is likely due to the Referer ACL denial, which can be addressed by allowing requests from your Vercel domain. Here is how you can configure the CORS settings:
[
{
"AllowedOrigins": ["https://your-project.vercel.app"],
"AllowedMethods": ["GET", "PUT", "HEAD", "POST", "DELETE"],
"AllowedHeaders": ["*"]
}
]
This setup will allow your Vercel-deployed web page to access resources from the Cloudflare R2 bucket, resolving the CORS error [3]. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
你是不是用了 .top 域名? |
Did you use a .top domain name? |
是的我使用了.top域名 |
Yes I used the .top domain name |
域名问题,top域名黑灰产太多,被禁了。 |
There is a domain name problem. The top domain name is too popular and has been banned. |
原来如此,有其他非.com且不会导致类似问题的顶级域名推荐么? |
I see, is there any recommendation for other top-level domain names that are not .com and will not cause similar problems? |
I found a similar closed issue regarding a 403 error caused by an unallowed referer, but no solution was found in the comments [1]. To resolve the CORS error preventing thumbnail images from displaying on a Vercel-deployed web page, you can configure the Cross-Origin Resource Sharing (CORS) settings in your Cloudflare R2 storage bucket. Here’s how:
This setup will allow your Vercel-deployed web page to access resources from the Cloudflare R2 bucket, resolving the CORS error [2]. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
除了.top其他的应该都没啥问题,找个看着顺眼、价格合适的就行。 |
Except for .top, everything else should be fine. Just find one that looks pleasing to the eye and is priced appropriately. |
好的谢谢你 |
ok thank you |
This issue is closed, If you have any questions, you can comment and reply. |
📦 Environment
Vercel
📌 Version
a20dfbd
💻 Operating System
Windows
🌐 Browser
Chrome
🐛 Bug Description
进入主页后缩略图不显示,控制台报错如:
Access to fetch at 'https://registry.npmmirror.com/@lobehub/chat/latest' from origin 'https://xxx.xxx.top' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
📷 Recurrence Steps
No response
🚦 Expected Behavior
No response
📝 Additional Information
No response
The text was updated successfully, but these errors were encountered: