-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Error: Expected a value of type 'xxx', but got one of type 'JavaScriptObject' when running with debug #47786
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
Comments
I'm able to reproduce the For the former error, it seems like
Can you chime in on the context here, @srujzs? |
It seems identical to that and similar bugs. Likely, the It is interesting that |
Duplicate of #45036. |
I'm reopening this issue even though the bug I duped this under has been resolved. It seems like this is a missing constructor issue, and not a wrong binding issue, so if that impression is correct, this problem should actually still persist in debug mode even though the other bug has been fixed. Unfortunately, this means this goes back to the grouping of classes we're unable to natively bind to the |
This issue is still not fixed and I don't see how this is a duplicate of of #45036. |
Unfortunately, it's unlikely we can get a good fix here that would unify the compilers without changing the way DDC detects native types, and the scope of that change might be quite large. We've been working on introducing new forms of interop that users can use to work around such problems with dart:html. Eventually, the goal is to move away from dart:html and move to a package that exposes the DOM using low-level interop. It's a WIP, but we're getting there: https://github.com/dart-lang/web. https://github.com/dart-lang/sdk/blob/main/sdk/lib/html/doc/WORKAROUNDS.md has some workarounds to show how you can use In your case, I think this might be resolved if you defined your own interface for |
Thank you very much, that helped a lot! We were able to access the correct Javascript objects using |
Not much to update here, but I added #53864 to describe the problem in DDC and why we are not planning to push on it at the moment. Our current plan is to leverage JS interop and package:web in the future to circumvent these issues. I'll be marking this issue as a duplicate. |
A flutter web app that uses dart:html runs fine in release mode but fails when running with debug.
We are writing a Flutter app that runs on the browser and accepts files dropped to the browser window.
The app listens for
onDrop
events and tries to retrieve the dropped object. In our code we are using typed variables (notdynamic
)This code runs fine when running in release mode:
However it fails when running in debug mode:
It seems that using the type
Entry
(dart API) confuses the debugger because there is no native JavaScript object that matches this name and/or signature.The text was updated successfully, but these errors were encountered: