Search-Bar is not working

I have created a search bar, but it is not working in my Lightbox. However, the same code works on another site. So what is wrong? The code is:

import wixData from “wix-data” ;

let lastFilterTitle ;
let debounceTimer ;

function filter ( title ) {
if ( lastFilterTitle !== title ) {
let newFilter = wixData . filter ();
if ( title )
newFilter = newFilter . contains ( ‘searchTags’ , title );

    $w ( '#dataset1' ). setFilter ( newFilter ); 
    lastFilterTitle  =  title ; 
} 

}

export function input1_change ( event ) {
filter($w ( ‘#input1’ ). value );
}

export function input1_keyPress ( event ) {
if ( debounceTimer ) {
clearTimeout ( debounceTimer );
debounceTimer = undefined ;
}
debounceTimer = setTimeout (() => {
filter($w ( ‘#input1’ ). value );
}, 500 );
}

I have double-checked, that I have the right “#input1” fieldcode, the right “#dataset1” fieldcode and the right “searchTags” fieldcode. Do you have any recommendations?