I try set tooltip for the VaadinIcon component. Tooltip is not work, show

I try set tooltip for the VaadinIcon component.

Tooltip is not work, show message:

Tooltips: js error: TypeError: Cannot read properties of undefined (reading ‘setTooltipToElement’);

code:

    Icon reply=VaadinIcon.REPLY.create();
     add(reply);
    Tooltips.getCurrent().setTooltip(reply,"reply");

Hi

Please take a look at the issue https://gitlab.com/gsedlacz/tooltips4vaadin/-/issues/42 to provide further information regarding the error.

I currently cannot reproduce the issue locally.

Best Regards

I happened to have the same issue and in the end I realised that tippy.js was not included in frontend. I double checked the package.json and tippy.js was no there.

I dedided to run a vaadin:clean-frontend and vaadin:dance and then build the frontend from scratch. Then my package.json was updated and included the missing dependency. After running the app again it worked.

Thank you for your feedback.


What was the previous version of the plugin before switching to 3.0.2?

Did you use version 3.0.0 or 3.0.1 before switching to 3.0.2 at some point in between?


Best Regards

Gerrit

Actually, I realised that when I managed to get tooltips working I had the devtools disabled (actually disappeared). I tried to recompile it and again the issue came up and at this point I tried to recompile and clean many times and the JS is not included.

I think something's up with 23.1. I thought it might be related to Vite build but I tried with webpack too and no luck.


Edit: looks like when the project is run with spring-boot:run the package.json is modified and the dependency gets removed.

Thank you a lot for following up on this.


I added your findings to to issue: https://gitlab.com/gsedlacz/tooltips4vaadin/-/issues/42


While Im not sure if theres anything I can do to prevent this Im gonna take a look at this with second project some time soon.


Best Regards

Gerrit

After I add de.f0rce.ace to vaadin.whitelisted-packages ,This error does not occur。


as a workaround for now we can add @JsModule("@vaadin/flow-frontend/js/tooltip/tooltips.js") into the main view.