cyntler / cyntler/react-doc-viewer

CORS error when fetch image from S3

Open
#71 9 comments 3 reactions 0 assignees View on GitHub
help wanted
Dominant language
TypeScript
Stars
481
Forks
147
PR merge metrics
No merged PRs in 30d

Description

![image](https://user-images.githubusercontent.com/89231623/196373593-0c63c32d-85f8-4117-bb42-421d7744e067.png)
![image](https://user-images.githubusercontent.com/89231623/196373768-4b06f350-edec-4dc3-9a26-f2efabe0fb02.png)
![image](https://user-images.githubusercontent.com/89231623/196374135-aae1e739-922c-49db-9f09-31d326fd929e.png)

*note: ImageDisplay is my custom image display

I faced this issue while working in my own project although in S3 i set Accpet-Control-Allow-Origin to '*' (image 3). I found out that if i write a fetch method to that s3 url its still face the same error but when i set mode: 'no-cors' it success. Anyone can explain why for me :( is there any way to work around or to set no-cors mode to reac-doc-viewer?

This is my first time submit an issue so plz appologize for any mistakes, thank you guys a lot.

Contributor guide

No contributing guide indexed for this repository

Research direction

The report identifies a custom ImageDisplay, an S3 URL, and fetch behavior with and without mode: 'no-cors'; start by reproducing that request and tracing the viewer's image-loading path. Done means the S3 image behavior is supported or the required CORS configuration and workaround are clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, react, typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.