Closed michaelheider closed 2 weeks ago
Recently I have also encountered this error :
SecurityError: Failed to execute 'texImage2D' on 'WebGL2RenderingContext': The image element contains cross-origin data, and may not be loaded.
May (or may not) be related to #981?
The error is in the setup. The Dockerfile
uses the master channel, while the dev machine uses stable.
The bug does happen also on the beta channel (locally and within docker, as expected).
Reopen without the Docker overhead as #986.
🐛 Bug Report
The below minimal sample looks fine. It does work when serving with
flutter run
or a local Python web server. But when served from a Docker container, the app crashes and the browser console spams errors.Expected behavior
Image displayed. No crash.
Reproduction steps
localhost:8080
.Sample
`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', ); } } ````Dockerfile`
```Dockerfile # Stage 1: build FROM debian:12-slim AS build # install build dependencies RUN apt-get -y update && \ apt-get -y install --no-install-recommends ca-certificates curl git \ lib32stdc++6 libgconf-2-4 libglu1-mesa libstdc++6 python3 unzip xz-utils zip && \ apt-get -y clean && \ rm -rf /var/lib/apt/lists/* # install Flutter ENV PATH="/usr/local/flutter/bin:/usr/local/flutter/bin/cache/dart-sdk/bin:${PATH}" RUN git clone https://github.com/flutter/flutter.git /usr/local/flutter && \ flutter doctor -v && \ flutter channel master && \ flutter upgrade && \ flutter config --enable-web && \ flutter precache --web # build app WORKDIR /app/ COPY . . RUN flutter build web --release EXPOSE 8080 CMD ["python3", "-m", "http.server", "8080", "--directory", "./build/web/"] ```Logs
First, a whole bunch of these:
Then, a whole bunch of these:
The complete stack traces are very long and unreadable. See an export here: 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.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
Version: 3.4.1
Platform: web