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
Polymer reference to image breaks build #17914
Comments
This comment was originally written by @zoechi I tried to use other paths like the one in the error message but that didn't work in Dartium. |
Added Area-Polymer, Triaged labels. |
If you make the change that the error message suggests, does it help? :) Siggi put those in to explain as best as possible what URIs to use. IIRC, the reason isn't actually ImportInliner, it's more about making sure the package can be consumed by other packages and apps without causing canonicalization errors. Basically, the HTML file and Dart files need to end up resolving to one path regardless of where they're imported from. cc @sigmundch. |
This comment was originally written by @zoechi Using the path in the error message didn't work in Dartium. |
Interesting. The path with extra ../../ was intended to work in Dartium too. I'm curious, what does the resolved path look like when the app tries to load that URI? how does it differ from the valid path? |
This comment was originally written by @zoechi It works for imports but not for |
mmm. Some parts of the system take care of rewriting src urls in 'img' tags, for example, but I'm not sure if we handle this correctly within custom-elements themselves. I'd have to take a closer look. What's the easiest way to run this? I'm currently trying to checkout polymer_ui_elements and building the 'example' folder (I noticed you are building from another package polymer_ui_elements_example that has a symlink to the examples here, I think now that pub supports building the example folder you shouldn't need that anymore). |
Ok, I looked a bit more into this. There are sort of two issues going on: * the other issue, which is why you are blocked, is that polymer-build is failing with an error. Turns out this only happens in special attributes like 'src', which we assume to be a URL attribute. I think in this case the polymer-build should give a warning and not an error, so pub-build can continue building your app. I just sent out a change to fix that: https://codereview.chromium.org/221673005/. In the meantime, the fastest way to get unblocked would be to rename 'src' to something else (e.g. 'src2' would do). Then the polymer build process will not try to rewrite it. We'd still need some logic to adjust the URI later, but at least the build process will generate some output code you can run. |
This comment was originally written by @zoechi Thanks a lot for taking a look so quick. I renamed the atribute to src2. I don't know if this is related but because of this I can't give feedback about your workaround. I'll update when I have more info. |
I wonder if this is because there are several examples being compiled. When I tried it I listed only that example in the entrypoints (for example: transformers:
) and called 'pub build example'. |
This comment was originally written by @zoechi You are right. Now it works. Thanks again! This was the first time I successfully built an example page inside the polymer-ui-elements library! |
This comment was originally written by @zoechi I spoke too soon #11. Building examples in polymer_elements package worked only for one entry_point. When I add more the build succeeds but the output doesn't work. |
:( - if you haven't already, please file a new bug for the pub folks to know about it. |
This comment was originally written by @zoechi This is a known bug https://code.google.com/p/dart/issues/detail?id=15038 |
This comment was originally written by @zoechi I just found out, that this image reference has a deployment issue. When I deploy the build output to a different directory the image can't be loaded I get the error that the resource couldn't be found at
when I move the image to this path it works. This isn't an issue with any of the other resources. |
Removed Area-Polymer label. |
This comment was originally written by @zoechi Is this related to Polymer/old-docs-site#472 |
interesting, I haven't heard of this either, I don't believe we have support for it in polymer.dart. Added this to the 1.6 milestone. |
Removed this from the 1.6 milestone. |
This issue has been moved to dart-archive/polymer-dart#152. |
This issue was originally filed by @zoechi
What steps will reproduce the problem?
1.
<polymer-ui-iconset id="polymer-ui-icons" src="../packages/polymer_ui_elements/polymer_ui_action_icons/action_icons.png" width="24" iconsize="24"
icons="drawer menu search dropdown close add trash refresh settings dialoga left right down up grid contact account plus time marker briefcase array columns list modules quilt stream maximize shrink sort shortcut dialog twitter facebook favorite gplus filter tag plusone dots">
<property theme="polymer-ui-light-theme" offsetx="24"></property>
<property theme="polymer-ui-dark-theme" offsetx="72"></property>
</polymer-ui-iconset>
(see also https://github.com/ErikGrimes/polymer_ui_elements/blob/master/lib/polymer_ui_icon/polymer_ui_icons.html)
this file is imported to
https://github.com/ErikGrimes/polymer_ui_elements/blob/master/lib/polymer_ui_icon/polymer_ui_icon.html
2.
When I build
[Error from ImportInliner on polymer_ui_elements_examples|web/polymer_ui_menu_item.html]:
package:polymer_ui_elements/polymer_ui_icon/polymer_ui_icons.html:14:1: Invalid url to reach to another package: ../packages/polymer_ui_elements/polymer_ui_action_icons/action_icons.png. Path reaching to other packages must first reach up all the way to the packages folder. For example, try changing the url above to: ../../../packages/polymer_ui_elements/polymer_ui_action_icons/action_icons.png
3.
This works in Dartium but pub build fails with above error message and
no output is generated for entry pages which import polymer-ui-icon.
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
Dart VM version: 1.3.0-dev.7.5 (Fri Mar 28 04:58:12 2014) on "linux_x64"
Polymer 0.10.0-pre.5
Please provide any additional information below.
I use another project to build the example pages because transformers had still troubles when I build the examples within this package when I tried recently.
The text was updated successfully, but these errors were encountered: