I recently updated all my components to
@import my main stylesheet in order to work with the new Chrome 35 shadow DOM implementation. Now that I've updated to Polymer 0.10 (.0 or .1), the app works just fine when built (with pub build), but the un-compiled app won't load in Dartium.
In Dartium, it always crashes in the part of platform.js (at line 20) that tries to interpret the @imported URL:
Breaking on exception: SyntaxError: Failed to construct 'URL': Invalid URL
I've tried various forms of the URL in the @import statement, all to no avail.
The error in Dartium's console is actually more useful than than what's shown in the Dart Editor's console, since it shows the original (non-minified) source, apparently through the magic of source maps. It dies here:
while ((matched = this.regex.exec(text))) {
--> u = new URL(matched[1], base);
matches.push({matched: matched[0], url: u.href});
}
I've tried updating to the -dev build, but there's no change.
Replacing the @imports within my components' styles with <link rel="stylesheet" href="css/main.css"> (and so on for font-awesome and bootstrap, since @importing them in my main.css doesn't work, this way) just outside the style element does get around the problem, but then my built index.html file jumps from 36K to 776K. Not insignificant.
What's the right solution, here? I suspect this is just a bug in platform.js. Can it be fixed easily?
- Geoff