sur950 / any_link_preview

A flutter Plugin/Package to show the preview of any web link that starts with HTTP/HTTPS. Mostly useful for application that had chat.
MIT License
69 stars 69 forks source link

ClientException: XMLHttpRequest error. #69

Open nc-jeni opened 4 months ago

nc-jeni commented 4 months ago

I get the following error code with no stack trace for further debugging.

AnyLinkPreview - Error in https://dr.dk response (ClientException: XMLHttpRequest error., uri=https://dr.dk)
AnyLinkPreview - Error in https://tv2.dk response (ClientException: XMLHttpRequest error., uri=https://tv2.dk)

I have been trying both with and wihout showMultimedia set.

Container(
  padding: const EdgeInsets.all(5),
  width: 100,
  height: 100,
  child: AnyLinkPreview(
    link: "https://dr.dk",
    // showMultimedia: true,
    displayDirection: UIDirection.uiDirectionHorizontal,
    cache: const Duration(hours: 1),
    errorWidget: Container(
      color: Colors.red[300],
      child: const Text('Oops!'),
    ),
  ),
)

Version info

any_link_preview: ^3.0.2
sur950 commented 3 months ago

Hi @nc-jeni

Can you share additional details like:

Thanks!

nc-jeni commented 2 months ago

Sure @sur950 It is working on the mobile platform (Android/iOS), but not on Web and it seems to be a problem with CORS.

alexrabin commented 2 months ago

I'm also getting this problem on web

Murtazakarim commented 3 weeks ago

It's not working on the web cause of cors policy

Hadjimamas commented 1 week ago

Same problem here any solution or steps to follow?