javascript

hallo i just moved in version 24 due to new version of tomcat
After restructured my project i noticed that my js functions are not working

For example
require(“save-html-as-image”)
import {saveAsPng, saveAsJpeg} from ‘save-html-as-image’;

window.Vaadin.Flow.label_print = {

print: function (id) {


    const node = document.getElementById('lb');



    saveAsPng(
        node,
        {filename: 'Report', printDate: true},
        {
            backgroundColor: 'rgba(255,255,255)',
            quality:2.0,


        }
    );
}

}
And im trying to call it as the version 14 but no success
Any help or suggestions pls?

How do you call it and do you see errors in the browser console?

html.getUI().get().getPage() .executeJs( "window.Vaadin.Flow.label_print.print($0,'lb')", html.getElement()); tha was my call and the error was that window.vaadin.flow was undefined
somewhere in the github i saw a “fix” that you can add in the properties this line com.vaadin.experimental.webpackForFrontendBuild=true
. Now is ok… for now

I doubt that that property has any effect in Vaadin 24. Webpack is long gone