question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Polymer Template cannot be found when inside a dependecy

See original GitHub issue

Description of the bug

Polymer Template cannot be found as soon as it is part of a dependency. The reason for this might be my own fault f.e. maybe @HTMLImport should not be used by addons?, or rather the lack of documentation for this very specific case. I would be really glad if somebody could help me out on this.

Minimal reproducible example

An example project can be found here to get the two behaviours:

  • run an install goal on the parent module
  • execute jetty:run on the addon module the template is found
  • execute jetty:run on the demo module the template cannot be found

Expected behavior

The template should be found.

Actual behavior

java.lang.IllegalStateException: Can't find resource 'context://iron-dropdown-wrapper/iron-dropdown-animation.html' via the servlet context
	at com.vaadin.flow.component.polymertemplate.DefaultTemplateParser.getTemplateContent(DefaultTemplateParser.java:104)
	at com.vaadin.flow.component.polymertemplate.TemplateDataAnalyzer.parseTemplate(TemplateDataAnalyzer.java:185)
	at com.vaadin.flow.component.polymertemplate.TemplateInitializer.<init>(TemplateInitializer.java:93)
	at com.vaadin.flow.component.polymertemplate.PolymerTemplate.<init>(PolymerTemplate.java:97)
	at com.vaadin.flow.component.polymertemplate.PolymerTemplate.<init>(PolymerTemplate.java:112)
	at com.github.appreciated.dropdown.IronDropdownWrapper.<init>(IronDropdownWrapper.java:30)
	at com.github.appreciated.dropdown.IronDropdownWrapper.<init>(IronDropdownWrapper.java:27)
	at com.github.appreciated.MainView.getIronDropDown(MainView.java:54)
	at com.github.appreciated.MainView.<init>(MainView.java:30)
	... 48 more

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
plekucommented, May 25, 2018

But it isn’t found in the addon module itself anymore

I think you need to define the resourceBase for the add-on module, see: https://github.com/vaadin/vaadin-grid-flow/blob/master/pom.xml#L123

1reaction
plekucommented, May 25, 2018

The tutorial https://vaadin.com/docs/v10/flow/web-components/creating-an-in-project-web-component.html describes how to make a component for a webapp project. There the files are put to the /webapp/ folder. I actually don’t see any place where we mention that where you should put the files when you make an add-on that has local resources that should go to a jar artifact.

Maybe we should add documentation / tutorial for this, if this was the issue. Thus an issue for vaadin/flow-and-components-documentation repository would be great.

Read more comments on GitHub >

github_iconTop Results From Across the Web

dart - Missing Polymer Element - Stack Overflow
I checked the homepage on github. It looks to be five months old. How can I get it when it's available? Do I...
Read more >
Data binding helper elements - Polymer Project
Polymer provides a set of custom elements to help with common data binding use cases: Template repeater ( dom-repeat ). Creates an instance...
Read more >
Annotation Type HtmlImport - Vaadin
Defines HTML dependencies on a Component class. ... In order to use a Polymer template inside a component in Vaadin 14+, JsModule annotation...
Read more >
Polymer 2 and TypeScript - Medium
Polymer can't be found for the extends . This is the most difficult of these errors to solve, because it is caused by...
Read more >
Angular elements overview
The content is provided by the component's template, which uses Angular ... an Angular component, together with its dependencies, to a custom element....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found