Lightbox Close buttons not working

Shahar,
Thank you for responding.

The failures are all in the member area, so I would have to set up a login for you to view them. But it does not matter because my question is now a general one.

Here are the relevant contents of my masterPage.js file:

import wixUsers from ‘wix-users’ ;
import {getArtistDirectoryProfile} from ‘public/welcome.js’ ;

$w.onReady( async function () {
let artistDirectoryProfile = await getArtistDirectoryProfile ();
if (wixUsers.currentUser.loggedIn) {
$w( ‘#containerArtistMenu’ ).show();
$w( ‘#buttonLogout’ ).show();
$w( ‘#buttonMember’ ).label = "Welcome " + artistDirectoryProfile.registrationEmail;
} else {
$w( ‘#containerArtistMenu’ ).hide();
$w( ‘#buttonLogout’ ).hide();
$w( ‘#buttonMember’ ).label = “Artist Sign-in” ;
}
})

The elements referenced are all in the header, and they need to be set on every page. That’s why I put them in the masterPage.js (site) file.

The problem is that for a lightbox, the element references now throw syntax errors. This did not used to happen; this file has been working fine on the public site for over a year. It just started breaking in the last few weeks.

The question is what is the correct way to control these elements in the header?
Cheers,
Bill