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

DeferredLibrary loading not working in dart2js output #9483

Closed
DartBot opened this issue Mar 28, 2013 · 14 comments
Closed

DeferredLibrary loading not working in dart2js output #9483

DartBot opened this issue Mar 28, 2013 · 14 comments
Assignees
Labels
closed-obsolete Closed as the reported issue is no longer relevant web-dart2js

Comments

@DartBot
Copy link

DartBot commented Mar 28, 2013

This issue was originally filed by @chrisbu


What steps will reproduce the problem?

  1. Follow the example given at: http://api.dartlang.org/docs/bleeding_edge/dart_async/DeferredLibrary.html

Specifically, my code looks like:

import 'dart:html';
import 'dart:async';

@lazy
import 'dialog_library.dart' as dialog;

const lazy = const DeferredLibrary('dialog_library');

void main() {
  query("#clickme").onClick.listen(() {
    lazy.load().then((
) => dialog.showOkCancelBox("I am a message box"));
  });
}

  1. Convert to js using dart2js. A part.js and part.js.map file is created ok
  2. Run the HTML file (in my app, this is called deferred.html ) in Chrome.

What is the expected output? What do you see instead?
Expect the part.js file to be loaded. A request for this is happening, but it's trying to load it from web/packages/browser rather than from /web. See the attached screenshot - interestingly, this seems to result in a cancelled request (rather than 404).

Secondly, if I try this in firefox (19.0.2) - it causes firefox to crash!

What version of the product are you using? On what operating system?
Win 64, editor+sdk: r20444, Chrome 26, Firefox 19.


Attachment:
deferredloading.png (75.90 KB)

@DartBot
Copy link
Author

DartBot commented Mar 28, 2013

This comment was originally written by @chrisbu


To confirm, I've also just tried this with r20602 and it has the same issue.

@dgrove
Copy link
Contributor

dgrove commented Mar 28, 2013

Set owner to @peter-ahe-google.
Added Area-Dart2JS, Triaged labels.

@peter-ahe-google
Copy link
Contributor

Chris,

Could you try this workaround:

const lazy = const DeferredLibrary('dialog_library', uri: '/web/part.js');

I suspect this is a dupe of issue #8455.


cc @vsmenon.

@kasperl
Copy link

kasperl commented Apr 22, 2013

Added this to the Later milestone.

@DartBot
Copy link
Author

DartBot commented Apr 24, 2013

This comment was originally written by @sethladd


Should we update the API docs in the meantime? I just ran into this issue, too.

@peter-ahe-google
Copy link
Contributor

I don't understand what the hold up is with issue #8455. I'd rather try to submit my suggested diff than update the docs.

@kasperl
Copy link

kasperl commented May 23, 2013

Added TriageForM5 label.

@kasperl
Copy link

kasperl commented May 28, 2013

Removed TriageForM5 label.

@peter-ahe-google
Copy link
Contributor

Marked this as blocking #3940.

@sethladd
Copy link
Contributor

Should we reassign?

@floitschG
Copy link
Contributor

Set owner to @sigurdm.

@kasperl
Copy link

kasperl commented Jul 10, 2014

Removed this from the Later milestone.
Added Oldschool-Milestone-Later label.

@kasperl
Copy link

kasperl commented Aug 4, 2014

Removed Oldschool-Milestone-Later label.

@sigurdm
Copy link
Contributor

sigurdm commented Apr 30, 2015

Added AssumedStale label.

@DartBot DartBot added Type-Defect web-dart2js closed-obsolete Closed as the reported issue is no longer relevant labels Apr 30, 2015
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-obsolete Closed as the reported issue is no longer relevant web-dart2js
Projects
None yet
Development

No branches or pull requests

7 participants