Skip to content

CORS Error: Unable to Fetch Data from dictionaryapi.dev #241

Open

Description

@ujjalballen

When fetching data from the https://api.dictionaryapi.dev/api/v2/entries/en/ "word" endpoint, the request is being blocked by the browser due to a CORS policy error. Previously, this API worked without any CORS issues, but it recently started showing the following message in the browser console.

In addition to the CORS error, the API sometimes returns a 522 status code at random, especially for words that do not exist in the dictionaryapi or when an invalid/wrong word is send ...

Image

Activity

  1. b2d3 commented on Oct 17, 2025

    @b2d3

    Same here ^

  2. ujjalballen commented on Oct 18, 2025

    @ujjalballen
    Author

    Same here ^

    Is it going to be fixed soon, mate, or will it stay like that? I'm not sure! It’s had this issue for a long time and still hasn’t been fixed.

  3. Smg065 commented on Oct 18, 2025

    @Smg065

    Taking a closer look, the const HEADER_ACCESS_CONTROL_ALLOW_ORIGIN is assigned as Access-Control-Allow-Origin.

    HEADER_ACCESS_CONTROL_ALLOW_ORIGIN = 'Access-Control-Allow-Origin';

    Here's the 2 spaces it's set as a wild card, one during error handling,

    this.set(HEADER_ACCESS_CONTROL_ALLOW_ORIGIN, '*');

    And one when the API tries to get the word.

    res.set(HEADER_ACCESS_CONTROL_ALLOW_ORIGIN, '*');

    In theory, that should be passing it correctly, but I think something's interrupting it before it gets to that line. We could confirm if someone was self-hosting this and it can still pull correctly.

    The 522 error from Cloudfare comes from a timeout. The 19 second SYN+ACK never received before, rather than the resource request from 90 seconds. You can count that one out by going to a random word.

    I haven't found a word that doesn't return a 522 yet from my own testing. Is it random on a per-word basis, or will it arbitrarily work and stop working with the same word attempted?

  4. ujjalballen commented on Oct 19, 2025

    @ujjalballen
    Author

    Taking a closer look, the const HEADER_ACCESS_CONTROL_ALLOW_ORIGIN is assigned as Access-Control-Allow-Origin.

    freeDictionaryAPI/app.js

    Line 32 in 4f274a8

    HEADER_ACCESS_CONTROL_ALLOW_ORIGIN = 'Access-Control-Allow-Origin';
    Here's the 2 spaces it's set as a wild card, one during error handling,

    freeDictionaryAPI/app.js

    Line 60 in 4f274a8

    this.set(HEADER_ACCESS_CONTROL_ALLOW_ORIGIN, '*');
    And one when the API tries to get the word.

    freeDictionaryAPI/app.js

    Line 114 in 4f274a8

    res.set(HEADER_ACCESS_CONTROL_ALLOW_ORIGIN, '*');
    In theory, that should be passing it correctly, but I think something's interrupting it before it gets to that line. We could confirm if someone was self-hosting this and it can still pull correctly.

    The 522 error from Cloudfare comes from a timeout. The 19 second SYN+ACK never received before, rather than the resource request from 90 seconds. You can count that one out by going to a random word.

    I haven't found a word that doesn't return a 522 yet from my own testing. Is it random on a per-word basis, or will it arbitrarily work and stop working with the same word attempted?

    Thanks for the detailed breakdown, really appreciate it! I also think it could be getting interrupted before it reaches that line, but I’m not sure.

    And your explanation about the 522 timeout and the missing SYN+ACK makes sense. From my side, it doesn’t seem tied to any specific word. However, today it’s consistently returning a 522 “Connection timed out” error for every request, regardless of the word. But after a few minutes, it works, although some words (like 'dictionary,' 'more,' 'fetch,' etc.) are not included in the Dictionary API. At those times, it returns a 522 error from Cloudflare.

    So it looks more like an intermittent issue with the public API or Cloudflare setup rather than the request itself.

  5. Smg065 commented on Oct 21, 2025

    @Smg065

    https://freedictionaryapi.com/
    The V1 version seems to still be working, unless there's another Wiktionary-based API that has /VX/ in the URL structurally that started with the whole dictionary and then moved over to only the English one.

  6. meetDeveloper commented on Oct 21, 2025

    @meetDeveloper
    Owner

    This should be working now. Sorry for the inconvenience. I will try to improve availability of the API so that such problems never occur. Thank you for using this API.

  7. sgbeal commented on Aug 11, 2026

    @sgbeal

    i get this on a full half of my requests. This screenshots shows debug entries for when words are clicked in my app. The ones with no error after them worked, the others failed. Sometimes it's a 404, which is fine, but the CORS errors are random, almost as if half of the servers serving that endpoint are misconfigured.

    Image
  8. comaeclipse commented on Aug 18, 2026

    @comaeclipse

    @sgbeal same here, unfortunately...

  9. adriennvarn commented on Aug 20, 2026

    @adriennvarn

    I'm also having this issue, but I get this error 100% of the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions