-
Notifications
You must be signed in to change notification settings - Fork 217
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
[How to use] Web deployment: Uncaught UnimplementedError #304
Comments
Also having this issue... |
Same here, local it works, once deployed it fails. |
I just found out that my issue was related to brave browser shield, after turning shields down it worked without uncaught exceptions |
Has anyone found a solution? I have the same problem) |
I ended up implementing pica on the web directly instead of using flutter_image_compress for web. Here are some workaround functions I made (my code is messy and implementation of these is also messy): final Stopwatch stopwatch = Stopwatch()..start(); final srcWidth = imageElement.width!; final ratio = srcWidth / srcHeight; print("Target size: ${width}x${height}"); // Create an offscreen canvas for resizing // Draw the image on the offscreen canvas // Convert the canvas content to a Blob reader.onLoadEnd.listen((_) { reader.readAsDataUrl(blob); final resizedImage = await completer.future; return resizedImage; Future convertUint8ListToImageElement(Uint8List buffer) async { image.onLoad.listen((_) { image.onError.listen((event) { return completer.future; extension CompressExt on CompressFormat { enum CompressFormat { jpeg, png, webp, heic, heif } |
Platforms
Web
Description
I've read the Web section on README, and I've already added
<script src="https://unpkg.com/pica/dist/pica.min.js" ></script>
inweb/index.html
.It runs well in my local including IOS and also web. But when I built and deployed, it always shows
Uncaught UnimplementedError
in console.Did I missed anything?
My code
Try do it
I've tried add
<script src="https://unpkg.com/pica/dist/pica.min.js" ></script>
on either head or body, also<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/pica.min.js" ></script>
on either head or body.But none of them works.
The text was updated successfully, but these errors were encountered: