-
Notifications
You must be signed in to change notification settings - Fork 53
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
CORS issue all of a sudden #24
Comments
same |
Yeah, I started getting the CORS errors as well. But they seem sporadic and hard to track down. Maybe this is the problem: it looks like the heroku proxy server that @Dhaiwat10 uses was down (at the time of my writing). edit: the proxy server is back up again and works |
Hey, like @ptenteromano said the public proxy probably got overloaded with too many requests. Highly suggest forking it and deploying your own! |
i also getting cors error how can deal with any one have answer please help |
I avoided using the proxy server altogether. You can pass in your own custom Look into the docs / source code for more information. const metaData = [{
title: ["Example Title"],
description: ["Example description..."],
image: "https://example.com/image.jpg",
url: "https://example.com/article",
siteName: ["Example Site"],
hostname: "example.com"
}]; // I defined the elements as a MetaData type previously.
// Adapt the loader response to the LinkPreview component
async function adapter(url: string): Promise<MetaData> {
const data = metaData.find((d) => d.url === url) as MetaData;
return Promise.resolve(data);
}
const urlData = {
url: "https://example.com/article",
explicitImgSrc: "https://images.unsplash.com/this-is-optional"
} Then in your component, you can call it: <LinkPreview
height="100%"
url={urlData.url}
fetcher={adapter}
explicitImageSrc={urlData.explicitImgSrc}
/> |
Hello.
I have been using your fantastic package for a month or so now with no problem, but for some reason I now seem to be getting a CORS error for all links.
Has something changed??
Cheers!
Dave
The text was updated successfully, but these errors were encountered: