JS Not Executing...on new site

I just created a new website and cut & pasted some elements and code from one of my other sites. The JS code on my new site does not execute. ??? Code below. The #dropdown444 selector doesn’t even exist and no error is thrown. Did I forget to turn something on? Did I take a stupid pill??

//
import { wixData } from ‘wix-data’ ;
export function button4_click(event, $w) {
//
$w( “#dataset1” ).setFilter(wixData.filter()
.contains( “boatType” , $w( ‘#dropdown1’ ).value)
.contains( “boatMaterial” , $w( ‘#dropdown2’ ).value)
.contains( “length_passenger” , $w( ‘#dropdown3’ ).value)
.contains( “Motor” , $w( ‘#dropdown444’ ).value))

    .then((results) => { 
        $w( '#repeater1' ).data = results.items; 
    }). **catch** ((err) => { 
        console.log(err); 
    }); 
$w( '#repeater1' ).expand(); 

}

If the dropdown444 doesn’t exist you can’r refer to it in your code.

(by the way, the repeater.expand() should be inside the .then() part, just after you assign the repeater data).

Thx JD. Yes, I realize the dropdown444 can’t be referred, but that is my point. I intentionally created a syntax error and the editor didn’t throw an “invalid selector” message. It’s like the editor/interpreter is not running/executing.

That’s why I ask, did I take a stupid pill somewhere? Is there some qualifier that turns the editor/interpreter on & off?

Answer: Yes, I did take a stupid pill. Turns out the JS Editor does not attempt to reconcile any code (within an event, e.g. on_click) if the event is not referenced (called) from the web page. Once I referenced my button to the on-click event handler, all is well.

It’s a very frequent issue. This is one of reasons why I prefer to use $w(“#button”).onClick(e => {/code/}) and not the export function button_click .
This way you can see every thing.