No Error message for existing Newsletter subscriber

Topic summary

A Shopify store owner is experiencing an issue where no error message appears when users attempt to subscribe to a newsletter with an email address that’s already registered.

Problem Details:

  • The default Shopify theme lacks built-in error messaging for duplicate newsletter subscriptions
  • Theme language settings don’t provide a solution for this scenario
  • Custom JavaScript code was attempted but failed to resolve the issue

Code Approach:

  • The developer tried detecting existing subscribers by checking URL parameters (form_type=customer)
  • Attempted to dynamically inject an error message (“You have already subscribed!”) when duplicate submissions occur
  • The code targets newsletter form elements and tries to append custom messaging

Current Status:
The issue remains unresolved. The developer is seeking help from others who may have successfully implemented duplicate subscriber error messaging in their Shopify themes.

Summarized with AI on November 10. AI used: claude-sonnet-4-5-20250929.

I am surprised that No error message reflect if the user has already subscribed the newsletter. No help in the Theme>Language

I tried with the custom code but it also didn’t change anything.

my custom code is here :

// Newsletter Already subscribed user - Error Message 
var live_url = window.location.href;
var result = live_url.includes('form_type=customer');
var input_val = document.querySelector('[id*="NewsletterForm"]').value.length;
//var input_val = document.querySelector('Contact_163955177715547d60').value.length;
//var input_val = document.querySelector('[id*="Contact_"]').value.length;

if(result && input_val != 0){
const add_ele = document.createElement("h3");
add_ele.innerText = "You have already subscribed!";
document.querySelector('.newsletter-form__field-wrapper').appendChild(add_ele);
add_ele.classList.add('newsletter_already_subscribe','newsletter-form__message','form__message');
}
 

Please help if anyone achieved it already. My theme is debut theme