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

Don't warn about dynamically injected script tags if the library is already loaded #22712

Closed
jakemac53 opened this issue Mar 6, 2015 · 7 comments
Labels
closed-obsolete Closed as the reported issue is no longer relevant 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

@jakemac53
Copy link
Contributor

When injecting an html import which contains a dartium script into the dom at runtime, dartium currently throws a warning since that script will not be loaded. If the library pointed to by that script is already loaded though, then it should not throw this warning.

This is going to be a relatively common case in newer polymer apps, and without it we are forced to either ignore the warning or do an annoying dance that requires adding an extra html import for every element (one that contains the dart file, and one that does not).

@jakemac53
Copy link
Contributor Author

Here is a really basic example situation https://gist.github.com/jakemac53/a5d272982ae3232d4dff

@jakemac53
Copy link
Contributor Author

Dartium actually has some code that is intended to do this, but it looks like its really just a url canonicalization issue. From index.dart the url looks like 'package:foo/foo.dart' but from the html import it looks like 'http://my_site.com/packages/foo/foo.dart'.

One idea is if the existing original check fails, then check if the url contains a prefix matching the existing package root ('http://my_site.com/packages' in this case). If it does replace that with 'package:' and check if that matches a currently loaded library. This is a bit hacky but its just to suppress an error so its probably perfectly fine.

@kasperl
Copy link

kasperl commented Mar 7, 2015

Added Triaged label.

@jakemac53
Copy link
Contributor Author

Any updates on this? This is forcing a pretty ugly workaround at the moment for anybody using polymer 0.16.0 (it now takes 3 files to create an element instead of 2 if you don't want dartium warnings).


cc @vsmenon.

@vsmenon
Copy link
Member

vsmenon commented Apr 9, 2015

jake: I think this is obsolete now. The call in Dartium that generated (validateUrlLoaded) this warning was removed in one of jacobr's recent changes:

http://src.chromium.org/viewvc/blink/branches/dart/dartium/Source/bindings/core/dart/DartController.cpp?r1=190940&r2=191142


cc @jacob314.
Added AssumedStale label.

@jakemac53
Copy link
Contributor Author

Looks like I am seeing a different error now, Inline Darts scripts not supported after main script is invoked.


Added Triaged label.

@tmst
Copy link

tmst commented Feb 4, 2016

Moving the following script tag from the index.html <head> into the <body> element stopped these errors from appearing in my Dartium console:
<script type="application/dart" src="index.dart"></script>

Don't ask me how I found out (hint: T&E). That's all I know. :-(

@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 triaged labels Mar 1, 2016
@matanlurey matanlurey added the closed-obsolete Closed as the reported issue is no longer relevant label Feb 9, 2018
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 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

6 participants