I am getting the below exception,
Caused by: java.lang.IllegalStateException: Couldn’t find the definition of the element with tag ‘slide-tab’ in any template file declared using ‘@JsModule’ annotations. Check the availability of the template files in your WAR file or provide alternative implementation of the method getTemplateContent() which should return an element representing the content of the template file
Note: I have frontend folder and have slidtab.js and css in the respective src and styles folder.
Any help would be appreciated to resolve the issue…
I just tried creating a new project with Vaadin 14.4.3 and SlideTab 2.2.1, and it worked for me.
I didn’t do a WAR deployment, but that should not matter.
How are you using the SlideTab? You shouldn’t need to move any JS or CSS files around, just add the dependency to pom.xml and then do, for example, add(new SlideTabBuilder(myContent).build(), and that should work.
I am using Spring boot and creating JAR. It is working fine in local if I have the slide-tab.js in the proper location but when we deploy in the AWS ECS, we are getting the "java.lang.IllegalStateException: Couldn’t find the definition of the element with tag ‘slide-tab’ in any template file declared using ‘@JsModule’ annotations. "
My assumption is slide-tab.js file somehow not properly bundled.
The issue can be reproduced in local, just re-naming the js file.
I believe that’s the issue, yes. I did get a similar result when running with that configuration. I am not too well versed in Webpack configs, so I can’t say how to solve it.
Thanks Erik, we do have others add-ons as part of our project. but not sure why only slide tab causing the mentioned issue even though webpack.config.js is customized…
I did have other problems with your Webpack configuration too, so it’s possible it failed for me because of some other reason. But I did get the error about not finding slide-tab.
Do you have the slide-tab in your filtered Flow imports?
Sorry, I am out of ideas. If at all possible, try running with a normal Webpack config, or then don’t filter out @vaadin/flow-frontend/src/slide-tab.js and see if it helps.
I think if you put a console.log(...) in the Webpack config and run npx webpack you could see if it filters out the JS files of the other add-ons you are using, too.