Login and sign up modals broken!?

My Login/sign up modal has broken (as shown in image) on one specific page of my webflow site.

The modal works fine on all other pages, however not this one (its a cms template page, example of the page is here: https://www.nextset.co.uk/programs/rp-gym-free)

In the page settings for this page, I am using some custom code to determine whether to show users the ‘Save program to Wishlist’ button or a similarly styled text field ‘Saved to Wishlist’. The code is below:

<script src="https://api.memberstack.io/static/memberstack.js?webflow" data-memberstack-id="0f0f6e604b7715a27224f11ab4faad82"> </script> 

MemberStack.onReady.then(async function(member) {

	// Checks if member is logged in
	const metadata = await member.getMetaData();

	// If no metadata.video exists, create it in MemberStack.
  	metadata.programs = metadata.programs || [];

	// Defines the webflow video ID to a const of itemID (Pull this from the CMS)
		const itemID = "{{wf {.....\} }}"

	// If they have the item ID in their profile, hide the form, show the 'completed button'
		document.getElementById('save-program-form').style.display = 'none';
		document.getElementById('program-saved').style.display = 'block';
	// When the button is clicked, if the itemID doesn't exist on their profile
	// add it, then push the metadata to MemberStack. 

  		if(metadata.programs.indexOf(itemID) === -1){




Is this what is messing up the formatting of the login/sign up modal? Or do you have any other ideas for what it might be? Thanks a lot!!

Having commented out the code and republished, it is clear that the issue lies in the custom code. Can anyone suggest a workaround where I can achieve the same metadata checking without screwing up the login/sign up modal?

Thanks so much!

Hey Huw :wave:

Welcome, and thank you for posting in the forum! :partying_face:

It looks like you may have 2 Memberstack scripts on the same page which causes this issue. Here is an article on how to solve this :smiley: