Skip to content
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

[Bug]: Wasm illegal cast #2966

Open
8 tasks done
flrnsbt opened this issue May 27, 2024 · 5 comments
Open
8 tasks done

[Bug]: Wasm illegal cast #2966

flrnsbt opened this issue May 27, 2024 · 5 comments
Labels
bug Something isn't working triage

Comments

@flrnsbt
Copy link

flrnsbt commented May 27, 2024

Platform

Web

Plugin

package_info_plus

Version

8.0.0

Flutter SDK

3.22.1 stable

Steps to reproduce

Use the packageInfoPlus package in any web app that you compile in wasm

Code Sample

No response

Logs

Uncaught RuntimeError: illegal cast
    at PackageInfoPlusWebPlugin.getAll inner (main.dart.wasm:0x5f030a)
    at _awaitHelperWithTypeCheck closure at org-dartlang-sdk:///dart-sdk/lib/_internal/wasm/lib/async_patch.dart:97:16 (main.dart.wasm:0x31d543)
    at closure wrapper at org-dartlang-sdk:///dart-sdk/lib/_internal/wasm/lib/async_patch.dart:97:16 trampoline (main.dart.wasm:0x31d62a)
    at _RootZone.runUnary (main.dart.wasm:0x31e10d)
    at _Future._propagateToListeners (main.dart.wasm:0x31dd21)
    at _Future._completeWithValue (main.dart.wasm:0x31e393)
    at _Future._asyncCompleteWithValue closure at org-dartlang-sdk:///dart-sdk/lib/async/future_impl.dart:721:29 (main.dart.wasm:0x31f629)
    at closure wrapper at org-dartlang-sdk:///dart-sdk/lib/async/future_impl.dart:721:29 trampoline (main.dart.wasm:0x31f640)
    at _startMicrotaskLoop (main.dart.wasm:0x31c9a3)
    at _startMicrotaskLoop tear-off trampoline (main.dart.wasm:0x31ca0d)

Flutter Doctor

florian@ubuntuflorian:~/Documents/flutter/pouwfrontend$ flutter --version
Flutter 3.22.1 • channel stable • https://github.com/flutter/flutter.git
Framework • revision a14f74ff3a (5 days ago) • 2024-05-22 11:08:21 -0500
Engine • revision 55eae6864b
Tools • Dart 3.4.1 • DevTools 2.34.3

Checklist before submitting a bug

  • I searched issues in this repository and couldn't find such bug/problem
  • I Google'd a solution and I couldn't find it
  • I searched on StackOverflow for a solution and I couldn't find it
  • I read the README.md file of the plugin
  • I'm using the latest version of the plugin
  • All dependencies are up to date with flutter pub upgrade
  • I did a flutter clean
  • I tried running the example project
@flrnsbt flrnsbt added bug Something isn't working triage labels May 27, 2024
@flrnsbt flrnsbt changed the title [Bug]: [Bug]: Wasm illegal cast May 27, 2024
Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days

@github-actions github-actions bot added the Stale label Aug 26, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 10, 2024
@arnaudruffin
Copy link
Contributor

Hi. I am facing the same issue, please reopen.

@arnaudruffin
Copy link
Contributor

I think I missed something. The issue is with device_info_plus and not package_info_plus, tell me if I need to open a new issue.

In the meantime:

Plugin : device_info_plus

Version
device_info_plus: ^10.1.2

Flutter SDK
3.24.2 stable

Steps to reproduce
use device_info_plus in a project compile for webasm. It compiles, but on the execution you got illegal cast errors.
Try the sample code below.
flutter build web --wasm --no-strip-wasm
cd build/web
dhttpd '--headers=Cross-Origin-Embedder-Policy=credentialless;Cross-Origin-Opener-Policy=same-origin'

You will get
main.dart.wasm:0x14d826 Uncaught RuntimeError: illegal cast at DeviceInfoPlusWebPlugin.deviceInfo (main.dart.wasm:0x14d826) at DeviceInfoPlugin.webBrowserInfo inner (main.dart.wasm:0x14d4ef) in the browser console.

Sample:
https://github.com/arnaudruffin/demo-asm-issue-in-deviceinfo, which is the example given from the documentation, only targeting web platform.

See https://docs.flutter.dev/platform-integration/web/wasm for more info

@miquelbeltran
Copy link
Member

Ah, yes, we should have a different ticket for each project, since it doesn't look it's exactly the same error cause.

@arnaudruffin
Copy link
Contributor

arnaudruffin commented Sep 12, 2024

Ok, i'll do it thanks.
edit: done: #3253

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants