Repository: flutter
Issue: [flutter_svg] Flutter_svg doens´t work over network
Labels: package,p: flutter_svg

_Imported from https://github.com/dnfield/flutter_svg/issues/601_

Original report by @roberto-donext on Sep 22, 2021

I have test this plugin using the network constructor and doesn´t work:
I get this error:

The following ProgressEvent$ object was thrown resolving a single-frame picture stream:
  [object ProgressEvent]

When the exception was thrown, this was the stack
Picture provider: NetworkPicture("https://DOMAIN/right-arrow.svg", headers: null, colorFilter: null)
Picture key: NetworkPicture("https://DOMAIN/right-arrow.svg", headers: null, colorFilter: null)

My code is:
```

Column(
                children: [
                  SvgPicture.network(
                    "https://DOMAIN/public/right-arrow.svg",
                    width: 100,
                    height: 100,
                    semanticsLabel: 'A shark?!',
                    placeholderBuilder: (BuildContext context) => Container(
                      padding: const EdgeInsets.all(10),
                      child: const CircularProgressIndicator(),
                    ),
                  )
                ],
              )

```

I tested this exactly SVG over the network (doesn´t work) and just copy it in the assets folder, so , using SvgPicture.asset. And this works... So, the problem is not in the svg, because is exactly the same. The problem i guest is with the Plugin.
I event tried to set the headers to this:
headers: {'Content-Type': 'image/svg+xml'},
But does not work as well.

Any suggestion?

Thanks


---
Comment by @zanpen2000 on Dec 15, 2021
got same problem here, any one ?

---
Comment by @Sunsiha on Mar 2, 2022
any solution?

---
Comment by @jacoblee1021 on Jan 21, 2023
same issue.

---
Comment by @apoleo88 on Jan 31, 2023
Same, for Flutter Web, it doesn't happen with the same SVG as an asset but gives an error when stored in Google Cloud Storage.

```
======== Exception caught by SVG ===================================================================
The following ProgressEvent$ object was thrown resolving a single-frame picture stream:
  [object ProgressEvent]

When the exception was thrown, this was the stack: 
Picture provider: NetworkPicture("https://firebasestorage.googleapis.com/v0/b/not_rea_bucket_name/o/ace.svg?alt=media", headers: null, colorFilter: null)
Picture key: PictureKey(Instance of 'NetworkPictureKeyData', colorFilter: null, theme: SvgTheme(currentColor: Color(0xff000000), fontSize: 16, xHeight: 8))
====================================================================================================
```

```
Flutter 3.7.0 • channel stable
Framework • revision b06b8b2710 (8 days ago) • 2023-01-23 16:55:55 -0800
Engine • revision b24591ed32
Tools • Dart 2.19.0 • DevTools 2.20.1
```



---
Comment by @apoleo88 on Feb 2, 2023
My bad. My issue was with web **CORS** restriction.

`flutter_svg` caught Exception doesn't show the real one, that was for me: `XMLHttpRequest error`

---
Comment by @davor-layer-four on Sep 12, 2023
> My bad. My issue was with web **CORS** restriction.
> 
> `flutter_svg` caught Exception doesn't show the real one, that was for me: `XMLHttpRequest error`

How did you fix your issue? I am having the same problem

---
Comment by @davor-layer-four on Sep 19, 2023
> > My bad. My issue was with web **CORS** restriction.
> > `flutter_svg` caught Exception doesn't show the real one, that was for me: `XMLHttpRequest error`
> 
> How did you fix your issue? I am having the same problem

I fixed it, it was related to CORS and Firebase Storage. Just follow this youtube video: https://www.youtube.com/watch?v=tvCIEsk4Uas