Irrespective of where you place the JS file of PolymetTemplate in add-ons, it will not get picked up by NpmTemplateParser when used it an application.
How to reproduce:
(1) Create an add-on Component by extending PolymerTemplate. (It can be as simple as the "hello world" example given in the Vaadin documentation).
(2) Create another project (in NPM mode) and try to use the Component defined in the add-on created in Step 1.
The NpmTemplateParser will complain about the non-existence of the JS file. (One can verify that the JS file is there in the jar file created by the add-on but still it won't get picked up by the template parser).
Where is the template file placed?
Any JS file in src/main/resources/META-INF/resources/frontend should be found from the jar files and be handle by webpack.
Please provide exact steps and not just general description.
We need the exact locations of your files to understand what's going on.
It's better to attach the project: in this case we may immediately see any info without asking the required info.
Most likely the issue is in the resource location as Mikael said.
Please check and give us the complete info.
Where is the template file placed?
Any JS file insrc/main/resources/META-INF/resources/frontendshould be found from the jar files and be handle by webpack.
Yes, the template file is placed in that folder only.
Please see the project attached for testing this.
mvn clean install
and try to use it in any application's view:
add(new TheAddon());
my-addon-project.zip
Thanks for the sample project. I noted that no one had considered making a PolymerTemplate add-on and we were checking the wrong path in the parser.
The file itself was copied as expected.
Hi, I'm experiencing this exact issue with 15.0.0 - the very same setup of my projects did work until now with the latest version of 14.
Wasn't the fix applied for Vaadin 15, or do I need to look for the error in the setup of my own projects?
Thanks in advance
Hi @KasparScherrer,
The fix has been applied to V15. Could you take another look at the setup of your projects and if you still think the problem is on the Flow side please create an issue for it. Thanks.
Most helpful comment
Thanks for the sample project. I noted that no one had considered making a PolymerTemplate add-on and we were checking the wrong path in the parser.
The file itself was copied as expected.