Baseflow / Baseflow/flutter_cached_network_image
On Beta Channel, Crashes with SecurityError
- Dominant language
- Dart
- Stars
- 2.6k
- Forks
- 731
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 1
Description
## 🔙 Regression
On Flutter beta channel, the below crashes the application. The stable branch is fine.
Possibly related to this [issue](https://github.com/flutter/flutter/issues/158093) with Flutter's `Image.network` widget.
### Old (and correct) behavior
Show the image.
### Current behavior
App crashes.
### Reproduction steps
1. build sample app
2. open sample app
3. monitor browser console for crash logs
`main.dart`
```dart
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/widgets.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return CachedNetworkImage(
imageUrl:
'https://fastly.picsum.photos/id/505/40/40.jpg?hmac=egB4BZLkmlPCkk32_xTVvQg2I8QZH2w369evjD3Q1Pk',
);
}
}
```
### Logs
First, a whole bunch of these:
```console
main.dart.js:3193 Uncaught Error: SecurityError: Failed to execute 'texImage2D' on 'WebGLRenderingContext': The image element contains cross-origin data, and may not be loaded.
```
Then, a whole bunch of these:
```console
main.dart.js:3193 Uncaught Error: RuntimeError: memory access out of bounds
at canvaskit.wasm:0xd89f
at canvaskit.wasm:0x83f5
at canvaskit.wasm:0x44a9e5
at canvaskit.wasm:0x723cd
at Tb. (canvaskit.js:116:52)
at Tb. (canvaskit.js:156:256)
at new PictureRecorder (canvaskit.js:105:189)
at cS.iG (main.dart.js:11501:13)
at xJ.$0 (main.dart.js:11178:7)
at Object.Oa (main.dart.js:1109:17)
```
The complete stack traces are very long and unreadable. See an export here: [browser-console.log](https://github.com/user-attachments/files/17278761/browser-console.log)
Depending on the surrounding app, the errors are also different, but go into a similar direction.
`Uncaught : Null check operator used on a null value` in here [browser-console_2.log](https://github.com/user-attachments/files/17278941/browser-console_2.log).
I have also seen something along the lines of (reciting from memory) Function Argument Missmatch Error, but cannot reproduce that case at the moment.
### Configuration
- Flutter version: Channel **beta**, 3.27.0-0.1.pre
- cached_network_image Version: 3.4.1
- Platform: web
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.