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

the dart2js compiled version of my app sometimes throws on startup: NoSuchMethodError : method not found: 'Symbol("[]")' Receiver: Instance of 'UnknownJavaScriptObject' #15193

Closed
DartBot opened this issue Nov 20, 2013 · 7 comments
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-obsolete Closed as the reported issue is no longer relevant library-js P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@DartBot
Copy link

DartBot commented Nov 20, 2013

This issue was originally filed by ross.dart...@gmail.com


r30437
Windows 7x64

The dart2js compiled version of my application throws the following error sometimes on startup:

NoSuchMethodError : method not found: 'Symbol("[]")'
Receiver: Instance of 'UnknownJavaScriptObject'
Arguments: ["isFile"]

The call stack where this happens is for an interop call using dart:js to the Chrome API method restoreEntry(id) to restore a file entry. So I am not 100% sure where the bug lies, whether with dart2js, dart:js, or Chrome. However, the Dartium (vm) version of my application does not experience this issue, so I suspect dart2js is involved somehow.

The strange thing is that this only seems to happen if I launch the application 'quickly' after closing a previous session. If I twiddle my thumbs for a minute or two and then relaunch, the issue goes away and the application launches without issue. Chrome apps have a notion of a 'background script' that is possibly coming into play here, as I think it hangs around for a short while after the application windows close, before it is suspended.

Please let me know if there are any other details I can provide here. Thanks to zones, I am able to catch this and not crash, but the user doesn't get to restore any of their previous session, so it is not a very good situation. I thought I was maybe going crazy until I stumbled upon these guys seeing the same issue here:

googlearchive/chromedeveditor#215 (comment)

thanks :)

@iposva-google
Copy link
Contributor

Added Area-Dart2JS, Triaged labels.

@peter-ahe-google
Copy link
Contributor

Removed Area-Dart2JS label.
Added Area-Library, Library-JS labels.

@justinfagnani
Copy link
Contributor

We're investigating this same bug in another app.

Currently I think the issue might be that Chrome is reusing a FileEntry object from the first run and returning it from restoreEntry(). The FileEntry object will have a cached JsObject associated with it, but because the JsObject is from a different JS context, it's not recognized as a Dart object. The change of behavior with how long you wait to restart the app would be explained by the apps background page being shutdown.

@DartBot
Copy link
Author

DartBot commented Dec 15, 2013

This comment was originally written by ross.dart.lan...@gmail.com


Thanks for investigating this Justin

@devoncarew
Copy link
Member

To add a bit more info, I did add some debugging code to the compiled JS, and same same JS object is being returned across sessions. So, the app has been closed, but the background page is still running. On the second run of the app, the same object from the first run is returned from the chrome.restoreEntry() call. We then see the UnknownJavaScriptObject issue.

@DartBot
Copy link
Author

DartBot commented Dec 19, 2013

This comment was originally written by ross.dart.lan...@gmail.com


I have applied the fix from Justin's CL 105893010 to my local SDK and it fixes this issue - do we have an ETA on landing the change?

thanks,

@justinfagnani
Copy link
Contributor

I'll get the fix in asap


Set owner to @justinfagnani.
Removed Priority-Unassigned label.
Added Priority-Medium, Started labels.

@DartBot DartBot added Type-Defect area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-js labels Dec 19, 2013
@kevmoo kevmoo added P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) and removed Priority-Medium labels Mar 1, 2016
@matanlurey matanlurey added the closed-obsolete Closed as the reported issue is no longer relevant label Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-obsolete Closed as the reported issue is no longer relevant library-js P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

7 participants