Back to Community

Troubleshooting Common YITH WooCommerce Wishlist JavaScript Errors

27 threads Sep 16, 2025 PluginYith woocommerce wishlist

Content

JavaScript errors are a common source of frustration for users of the YITH WooCommerce Wishlist plugin. These errors can manifest as console warnings, broken functionality, or even the dreaded 404 "Not Found" for missing files. Based on community reports and solutions, this guide will help you diagnose and resolve the most frequent JavaScript-related issues.

Common JavaScript Errors and Their Causes

Here are some of the most frequently reported errors, along with their typical causes:

  • 404 Error for add-to-wishlist-gutenberg.min.js: This error occurs when the plugin attempts to enqueue a JavaScript file for its Gutenberg block that was removed in a previous update. The file reference remains in the code, but the physical file is no longer present in the /assets/js/ directory. This is a known bug that the YITH WooCommerce Wishlist team has acknowledged and fixed for an upcoming release.
  • Uncaught TypeError: Cannot read property 'contains' of undefined: This error often relates to the plugin's script trying to interact with page elements (like the wishlist table) that have not yet loaded or do not exist on the current page. It was a known issue patched in version 3.0.10 of the plugin.
  • Uncaught TypeError: e.addedNodes.forEach is not a function / t.split is not a function: These errors are often related to compatibility issues with how the plugin's script handles data returned from AJAX calls, particularly when dealing with dynamic page content or variations.
  • 403 Error on admin-ajax.php: A 403 (Forbidden) error on the admin-ajax.php file is typically not a bug in the Wishlist plugin itself. It is usually a server-level security restriction, such as a mod_security rule or a firewall blocking the POST request from the wishlist script.
  • Conflicts with Other Plugins or Themes: Custom JavaScript from your theme or other plugins (e.g., for notifications or select dropdowns) may not apply to the wishlist page because its content is often loaded dynamically via AJAX after the initial page load. Furthermore, the wishlist plugin can sometimes modify the DOM attributes of elements from other plugins, causing conflicts.

Step-by-Step Troubleshooting Guide

Follow these steps to identify and resolve JavaScript issues with your wishlist.

Step 1: Basic Checks

  1. Update Everything: Ensure your YITH WooCommerce Wishlist plugin, WordPress, theme, and WooCommerce are all updated to their latest versions. Many historical JS errors, like the "contains" error, were resolved in specific plugin updates.
  2. Conflict Test: Temporarily switch to a default WordPress theme (like Twenty Twenty-Four) and disable all plugins except for WooCommerce and YITH Wishlist. If the error disappears, re-enable your plugins and theme one by one to identify the source of the conflict.
  3. Clear Caches: Clear any caching on your site, including server-side caches, plugin caches, and your browser cache.

Step 2: Apply Known Fixes and Workarounds

For the add-to-wishlist-gutenberg.min.js 404 Error:
This is a harmless error but can clutter your console. The permanent fix will be included in a future plugin update. As a temporary workaround, you can use a code snippet to prevent the script from being enqueued. Add the following code to your child theme's functions.php file:


// Dequeue the missing Gutenberg script
add_action( 'wp_enqueue_scripts', function() {
    wp_dequeue_script( 'yith-wcwl-gutenberg' );
}, 20 );

For AJAX and TypeError Issues:
If you are experiencing issues that were supposedly fixed in a newer version but persist, it's possible a patch was not fully applied. In the past, the YITH team has provided direct file replacements. Monitor the official support threads for any patches or wait for the next stable release.

For CSS Not Applying (Often a JS-related loading issue):
If your custom CSS only works after refreshing with the browser console open, it's likely because the wishlist content is loaded asynchronously. Ensure your CSS is specific enough and is being loaded on the correct page. You may need to use !important declarations or hook your CSS into the wishlist page specifically.

Step 3: Advanced Debugging

  • Check the Browser Console: Right-click on your page, select "Inspect," and go to the "Console" tab. This will show you any active errors. Reproduce the action that breaks (e.g., adding to the wishlist) and note the exact error message and file.
  • Review Custom Code: If you are using any custom code snippets (e.g., to dequeue assets), ensure they are updated and compatible with the current version of the plugin. An outdated snippet can cause critical errors.

When to Seek Further Help

If the steps above do not resolve your issue, the problem may be highly specific to your environment. When seeking help in community forums, be prepared to provide the following:

  • The exact error message from your browser console.
  • The URL of the page where the error occurs.
  • A list of your active plugins and your theme name.
  • Any custom code related to the wishlist that you are using.

By systematically working through these steps, you can silence those console errors and ensure a smooth experience for your customers using the wishlist feature.

Related Support Threads Support