-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Comments
Here is a really basic example situation https://gist.github.com/jakemac53/a5d272982ae3232d4dff |
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. |
Added Triaged label. |
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. |
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: cc @jacob314. |
Looks like I am seeing a different error now, Added Triaged label. |
Moving the following script tag from the index.html <head> into the <body> element stopped these errors from appearing in my Dartium console: Don't ask me how I found out (hint: T&E). That's all I know. :-( |
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).
The text was updated successfully, but these errors were encountered: