CORS error when using from frontend
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- typescript
Research direction
Start with the linked minimal setup project and reproduce the failed preflight OPTIONS request in Firefox. Compare the library request with the direct fetch example in the issue, then trace the library entry point used by the frontend. Done means the frontend can make the same request without a CORS preflight failure.
Written by the indexing model from the issue text.
Description
I get a CORS error (preflight OPTIONS request fails) when I try to use the library from a frontend app.
I created a minimal setup project here https://github.com/makmonty/ra-bug-min-rep
Note: I don't get the error if I do the same requests with my own implementation as such:
const result = await fetch('https://retroachievements.org/API/API_GetGame.php?y=<webApiKey>&z=<username>&i=<gameId>')
const data = await result.json()
So it's not a configuration issue at the API side.
My environment is:
Browser: Firefox 131.0
SO: Arch Linux
- Dominant language
- TypeScript
- Stars
- 77
- Forks
- 18
- PR merge metrics
- No merged PRs in 30d
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from RetroAchievements/api-js
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
RetroAchievements/api-js#142 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
RetroAchievements/api-js#140 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
RetroAchievements/api-js#138 · 2 comments ·
-
deprecate the `userName` field and make it optionalMay be free again @wescopeland claimed this 772 days ago, and no pull request is open. Openkind/enhancement
RetroAchievements/api-js#105 · 1 assignee ·
All issues in RetroAchievements/api-js
Similar issues
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
inu-appcenter/memorIN-frontend#106 ·
Maintainers usually reply within 1 day
-
kind/bug
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 7 days
-
[Bug] @deck.gl/arcgis dist import resolves to unpublished @deck.gl/core source path (9.3.11, 9.4.0)Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
CSCfi/sd-search-ui#145 ·
Maintainers usually reply within 1 day
-
Add: Cbeebies pl SDOpencheck:passed streams:add
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day