Title: Uncaught ReferenceError: wp is not defined
Last modified: July 22, 2020

---

# Uncaught ReferenceError: wp is not defined

 *  Resolved [philraymond](https://wordpress.org/support/users/philraymond/)
 * (@philraymond)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/uncaught-referenceerror-wp-is-not-defined-2/)
 * I’m getting an error:
 * Uncaught ReferenceError: wp is not defined
 * It’s referring to this script, which I believe is WooCommerce code:
 * <script>( function( domain, translations ) {
    var localeData = translations.locale_data[
   domain ] || translations.locale_data.messages; localeData[“”].domain = domain;
   wp.i18n.setLocaleData( localeData, domain ); } )( “default”, { “locale_data”:{“
   messages”: { “”: {} } } } );</script>

Viewing 10 replies - 1 through 10 (of 10 total)

 *  Plugin Support [Thu P. a11n](https://wordpress.org/support/users/thup90/)
 * (@thup90)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/uncaught-referenceerror-wp-is-not-defined-2/#post-13158444)
 * Hi there,
 * This is likely caused by a theme/ plugin conflict.
 * The best way to determine if the issue is being caused by a theme and/or plugin
   is to temporarily switch your theme to Storefront ([https://woocommerce.com/products/storefront/?aff=10486&cid=1131038](https://woocommerce.com/products/storefront/?aff=10486&cid=1131038))
   and disable all plugins except for WooCommerce. Finally, test to see if the issue
   is resolved by checking to see if the error is gone.
 * To figure out which plugin is causing the problem, continue to the next step –
   reactivate your other plugins one by one, testing after each, until you find 
   the one causing conflict.
 * Here’s a more extensive explanation in our docs: [https://docs.woocommerce.com/document/how-to-test-for-conflicts/](https://docs.woocommerce.com/document/how-to-test-for-conflicts/)
 * —–
 * Tools to help you troubleshoot:
 * Meks Quick Plugin Disabler is a plugin you can install which will remember what
   plugins you currently have active so it’s easy to switch them back on. Link: 
   [https://wordpress.org/plugins/meks-quick-plugin-disabler/](https://wordpress.org/plugins/meks-quick-plugin-disabler/)
 * You can clone your site to a staging environment and perform tests without modifying
   your live site or impacting customers. Many hosts provide staging facilities,
   so it’s worth checking in with them. It’s also possible to do it using the free
   WP Staging plugin. Link: [https://wordpress.org/plugins/wp-staging/](https://wordpress.org/plugins/wp-staging/)
 *  Thread Starter [philraymond](https://wordpress.org/support/users/philraymond/)
 * (@philraymond)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/uncaught-referenceerror-wp-is-not-defined-2/#post-13166121)
 * Thank you. It was the ‘Load Javascript deferred’ setting in WP Rocket. I’ve turned
   it off and now all is well.
 *  [bonovski](https://wordpress.org/support/users/bonovski/)
 * (@bonovski)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/uncaught-referenceerror-wp-is-not-defined-2/#post-13266582)
 * I have the same problem using autoptimize.
    When I turn off file aggregation 
   the error doesn’t show up.
 *  [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/uncaught-referenceerror-wp-is-not-defined-2/#post-13266604)
 * Excluding just the right files (try `wp-includes/js`) should help too bonovski.
 *  [bonovski](https://wordpress.org/support/users/bonovski/)
 * (@bonovski)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/uncaught-referenceerror-wp-is-not-defined-2/#post-13266712)
 * Thanks for the suggestion, this does work but adds 12 additional network requests.
 *  [tripledm](https://wordpress.org/support/users/tripledm/)
 * (@tripledm)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/uncaught-referenceerror-wp-is-not-defined-2/#post-14012971)
 * Did you manage to find out the exact file(s) to exlude apart from wp-includes/
   js?
 * Thank you for this post it helped me trace down the issue 🙂
 *  [tripledm](https://wordpress.org/support/users/tripledm/)
 * (@tripledm)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/uncaught-referenceerror-wp-is-not-defined-2/#post-14013000)
 * found it, with some luck but glad I could share the file that solved it for me:
   
   wp-includes/js/dist/i18n.min.js For me excluding that solved it all round without
   excluding all in the /wp-includes/js folder
 *  [mquiggeorgia](https://wordpress.org/support/users/mquiggeorgia/)
 * (@mquiggeorgia)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/uncaught-referenceerror-wp-is-not-defined-2/#post-14290006)
 * For me it was the Async Javascript plugin.
    -  This reply was modified 5 years, 2 months ago by [mquiggeorgia](https://wordpress.org/support/users/mquiggeorgia/).
 *  [mawo1985](https://wordpress.org/support/users/mawo1985/)
 * (@mawo1985)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/uncaught-referenceerror-wp-is-not-defined-2/#post-14296235)
 * Hi there, having an error which seems similar to yours but havn´t found a solution
   yet.
 * Uncaught ReferenceError: wp is not defined
    <anonymous> [https://profil-fabrik.de/wp-admin/js/color-picker.min.js?ver=5.7:2](https://profil-fabrik.de/wp-admin/js/color-picker.min.js?ver=5.7:2)
   <anonymous> [https://profil-fabrik.de/wp-admin/js/color-picker.min.js?ver=5.7:2](https://profil-fabrik.de/wp-admin/js/color-picker.min.js?ver=5.7:2)
 * URL
    [https://profil-fabrik.de/produkt/neu-responsive/](https://profil-fabrik.de/produkt/neu-responsive/)
 * As I switched over from divi builder back to storefront the error was not shown
   anymore but of course I want to keep the divi builder as a great tool.
 * Is there any chance to solve this issue?
    THX in Advance
 *  [Jorge Razor](https://wordpress.org/support/users/jorgehoffmann/)
 * (@jorgehoffmann)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/uncaught-referenceerror-wp-is-not-defined-2/#post-14343150)
 * Hello, for those having trouble with Autoptimize and/or Async JavaScript, the
   solution for me was to set these folders/files on exclude field of both plugins:
 * wp-includes/js/dist/, wp-includes/js/tinymce/, js/jquery/jquery.js, js/jquery/
   jquery.min.js
 * All errors gone.
 * I hope it helps you all.

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Uncaught ReferenceError: wp is not defined’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 10 replies
 * 8 participants
 * Last reply from: [Jorge Razor](https://wordpress.org/support/users/jorgehoffmann/)
 * Last activity: [5 years, 1 month ago](https://wordpress.org/support/topic/uncaught-referenceerror-wp-is-not-defined-2/#post-14343150)
 * Status: resolved