Skip to content
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

PolymerTemplate JS files from add-ons won't get picked up by NpmTemplateParser #6069

Closed
syampillai opened this issue Jul 15, 2019 · 7 comments · Fixed by #6091
Closed

PolymerTemplate JS files from add-ons won't get picked up by NpmTemplateParser #6069

syampillai opened this issue Jul 15, 2019 · 7 comments · Fixed by #6091

Comments

@syampillai
Copy link

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).

@project-bot project-bot bot added this to Inbox - needs triage in OLD Vaadin Flow ongoing work (Vaadin 10+) Jul 15, 2019
@caalador
Copy link
Contributor

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.

@denis-anisimov
Copy link
Contributor

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.

@project-bot project-bot bot moved this from Inbox - needs triage to In progress in OLD Vaadin Flow ongoing work (Vaadin 10+) Jul 15, 2019
@denis-anisimov denis-anisimov moved this from In progress to Product backlog in OLD Vaadin Flow ongoing work (Vaadin 10+) Jul 15, 2019
@syampillai
Copy link
Author

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.

Yes, the template file is placed in that folder only.

@syampillai
Copy link
Author

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

@caalador
Copy link
Contributor

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.

@mehdi-vaadin mehdi-vaadin moved this from In progress to Iteration Backlog in OLD Vaadin Flow ongoing work (Vaadin 10+) Jul 24, 2019
@denis-anisimov denis-anisimov moved this from Iteration Backlog to In progress in OLD Vaadin Flow ongoing work (Vaadin 10+) Jul 24, 2019
@denis-anisimov denis-anisimov self-assigned this Jul 24, 2019
@joheriks joheriks assigned joheriks and unassigned joheriks Jul 24, 2019
@denis-anisimov denis-anisimov removed their assignment Jul 24, 2019
@denis-anisimov denis-anisimov moved this from In progress to Review in progress in OLD Vaadin Flow ongoing work (Vaadin 10+) Jul 25, 2019
OLD Vaadin Flow ongoing work (Vaadin 10+) automation moved this from Review in progress to Done - pending release Jul 25, 2019
@mehdi-vaadin mehdi-vaadin added this to the 2.0.6 milestone Aug 2, 2019
@KasparScherrer
Copy link

KasparScherrer commented Mar 5, 2020

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

@mehdi-vaadin
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
OLD Vaadin Flow ongoing work (Vaadin ...
  
Done - pending release
Development

Successfully merging a pull request may close this issue.

6 participants