Skip to content
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

BooruError: Failed to execute 'fetch' on 'Window': Illegal invocation #51

Closed
AkashAryal opened this issue Jun 18, 2020 · 3 comments
Closed
Assignees
Labels

Comments

@AkashAryal
Copy link

AkashAryal commented Jun 18, 2020

Not sure if this is an issue on my end, but I get the above error when running

export const getLinks = (): AppThunk => dispatch => { 

  Booru.search('safebooru', ['glaceon'], { limit: 3, random: true })
    .then((posts: BooruPost[]) => {
      let arr = posts.map((p: BooruPost) => {
        return p.fileUrl;
      });
      dispatch(populate(arr));
    }).catch((err: any) => {
      console.error("whomp whomp  " + err)
    });

};

Also, I'm using this in a react, redux web app if that is relevant.

@AtoraSuunva
Copy link
Owner

Seems to be a duplicate of #35

Can you try the latest dev version (npm i booru@dev) and telling me if that fixes it? I don't have a setup able to reproduce this error.

@AtoraSuunva AtoraSuunva self-assigned this Jun 19, 2020
@AkashAryal
Copy link
Author

Now i get
image

@AtoraSuunva
Copy link
Owner

That's an issue with safebooru missing CORS headers.

Unfortunately there's nothing I can do in this package to resolve this, either safebooru needs to add a Access-Control-Allow-Origin header to their API or you need to find a way to get around the CORS restriction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants