Title: Uncaught ReferenceError: DateFormatter is not defined
Last modified: September 4, 2020

---

# Uncaught ReferenceError: DateFormatter is not defined

 *  Resolved [jetxpert](https://wordpress.org/support/users/jetxpert/)
 * (@jetxpert)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/uncaught-referenceerror-dateformatter-is-not-defined/)
 * Our browser console is showing the following error on all pages that load events:
 * `Uncaught ReferenceError: DateFormatter is not defined`
 * Click [here](http://prntscr.com/ubpskw) for details.
 * **Affected files:**
 * `/wp-content/plugins/the-events-calendar/src/resources/js/events-dynamic.js`
 * `/wp-content/plugins/the-events-calendar/src/resources/js/events-dynamic.min.
   js`
 * Click [here](http://prntscr.com/ubprtb) for details.
 * We deactivated all plugins except core plugins and TEC, but the problem persists.
   We’re using WP 5.5.1, TEC 5.1.6, and PHP 7.3.16
 * What’s going on? We need a fix.
 * Help appreciated. Thank you!

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

 *  [Santiago](https://wordpress.org/support/users/sjaure/)
 * (@sjaure)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/uncaught-referenceerror-dateformatter-is-not-defined/#post-13428728)
 * Hi [@jetxpert](https://wordpress.org/support/users/jetxpert/),
    Thanks for writing
   in,
 * From what I see in the console, you seem to be missing this file in your site
   > wp-content/plugins/the-events-calendar/vendor/php-date-formatter/js/php-date-
   formatter.min.js
 * Could you have a look and let me know if that’s the case?
 * Best
    Santiago
 *  Thread Starter [jetxpert](https://wordpress.org/support/users/jetxpert/)
 * (@jetxpert)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/uncaught-referenceerror-dateformatter-is-not-defined/#post-13434323)
 * Hi [@sjaure](https://wordpress.org/support/users/sjaure/),
 * Thank you for your assistance. Truly appreciated.
 * We have that file in our website, and it’s loading properly.
 * We use “Perfmatters” — a script management plugin — and have made sure the file
   you mentioned is not blocked or dequeued. Click [here](http://prntscr.com/ul73tm)
   and [here](http://prntscr.com/ul77vf) for details.
 * The funny thing is that now we’re getting a different console error on the same
   events pages (we didn’t change anything). Click [here](http://prntscr.com/ul7aqx)
   and [here](http://prntscr.com/ul7blf) for details.
 * The console error message is:
 *     ```
       Uncaught SyntaxError: Unexpected token u in JSON at position 0
           at JSON.parse (<anonymous>)
           at events-dynamic.min.js:1
           at events-dynamic.min.js:1
       ```
   
 * In any case, we checked our website in detail and found that the above errors
   are not causing any known or perceptible issues with our Events pages. We also
   checked the “net” for an explanation and found none related to this topic.
 * If you’d like to help pursue this with your developers to help explain the errors
   and/or provide a fix, that would be great. Otherwise, consider this a “beware”
   topic for the community.
 *  Thread Starter [jetxpert](https://wordpress.org/support/users/jetxpert/)
 * (@jetxpert)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/uncaught-referenceerror-dateformatter-is-not-defined/#post-13435662)
 * **Update:**
 * Latest error reported above was replaced with the original, DateFormatter error
   we originally reported. This happened after we cleared our browser’s cache using
   localStorage.clear
 * So … we’re back to the original issue.
 * To assist you further, we queried again the script giving the error and [this is what we found](http://prntscr.com/ulcsoj).
 * So, it appears the file that is causing the problem is: (above code is contained
   in this file)
 * `wp-content/plugins/the-events-calendar/src/resources/js/events-dynamic.min.js`
 * Can you ask your developers to revisit the file’s code to see if there’s an issue
   with it? (e.g., punctuation, spacing, etc.)
 * Thank you!
    -  This reply was modified 5 years, 8 months ago by [jetxpert](https://wordpress.org/support/users/jetxpert/).
    -  This reply was modified 5 years, 8 months ago by [jetxpert](https://wordpress.org/support/users/jetxpert/).
 *  [Jaime](https://wordpress.org/support/users/jaimemarchwinski/)
 * (@jaimemarchwinski)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/uncaught-referenceerror-dateformatter-is-not-defined/#post-13498658)
 * Hi [@jetxpert](https://wordpress.org/support/users/jetxpert/)
 * Thanks for providing us with that information.
 * Have you tried this out with a bare install of a default WordPress theme like
   Twenty Twenty and no other plugins installed besides The Events Calendar?
 * Let me know!
 * Thanks,
    Jaime
 *  Thread Starter [jetxpert](https://wordpress.org/support/users/jetxpert/)
 * (@jetxpert)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/uncaught-referenceerror-dateformatter-is-not-defined/#post-13499085)
 * Hi [@jaimemarchwinski](https://wordpress.org/support/users/jaimemarchwinski/),
 * Thanks for helping. Yes, did that. Same error.
 * Again, as stated above, it appears the problem lies with the file:
 * `wp-content/plugins/the-events-calendar/src/resources/js/events-dynamic.min.js`
 * The function, “DateFormatter”, is either not defined or improperly defined. Not
   a coder, so wouldn’t know.
 * The error has not impacted our calendar displays, but still something worth looking
   into (could impact future website performance)
 * Hoping you can ask your developers to revisit the offending file for errors or
   format.
 * Thank you.
 *  [Jaime](https://wordpress.org/support/users/jaimemarchwinski/)
 * (@jaimemarchwinski)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/uncaught-referenceerror-dateformatter-is-not-defined/#post-13503949)
 * Hi [@jetxpert](https://wordpress.org/support/users/jetxpert/)
 * Thanks for your response. I will have our developers look into this issue.
 * Have a wonderful day!
 * Thanks,
    Jaime
 *  Thread Starter [jetxpert](https://wordpress.org/support/users/jetxpert/)
 * (@jetxpert)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/uncaught-referenceerror-dateformatter-is-not-defined/#post-13504649)
 * [@jaimemarchwinski](https://wordpress.org/support/users/jaimemarchwinski/),
 * Thank you! When they look at the file, please make sure they also look at the“
   help” vs “helper” code lines. Shouldn’t it be just “help” throughout the file?
   Code lines are using a combination of both.
 * Click [here](http://prntscr.com/uuvc4a) for details.
 * Again, thank you.
 *  [Jaime](https://wordpress.org/support/users/jaimemarchwinski/)
 * (@jaimemarchwinski)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/uncaught-referenceerror-dateformatter-is-not-defined/#post-13509265)
 * Hi [@jetxpert](https://wordpress.org/support/users/jetxpert/)
 * Thanks for the follow-up here. I will add this information to my report.
 * Cheers,
    Jaime
 *  Thread Starter [jetxpert](https://wordpress.org/support/users/jetxpert/)
 * (@jetxpert)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/uncaught-referenceerror-dateformatter-is-not-defined/#post-13576370)
 * Hi [@jaimemarchwinski](https://wordpress.org/support/users/jaimemarchwinski/),
 * Any updates on this?
 * We are not experiencing any apparent functionality issues with your plugin, but
   it would certainly help if one of your “gurus” can look at this and confirm the
   issues.
 * Thank you!
 *  [Jaime](https://wordpress.org/support/users/jaimemarchwinski/)
 * (@jaimemarchwinski)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/uncaught-referenceerror-dateformatter-is-not-defined/#post-13581302)
 * Hi [@jetxpert](https://wordpress.org/support/users/jetxpert/)
 * Thanks for letting me know. I don’t quite have an update here because I haven’t
   been able to confirm the issue on our local site.
 * Can you try updating to the most recent version of the plugin and let me know
   if the issue is still occurring?
 * Can you also provide me with your system information?
    [https://theeventscalendar.com/knowledgebase/k/sharing-your-system-information/](https://theeventscalendar.com/knowledgebase/k/sharing-your-system-information/)
 * Thanks,
    Jaime
 *  Thread Starter [jetxpert](https://wordpress.org/support/users/jetxpert/)
 * (@jetxpert)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/uncaught-referenceerror-dateformatter-is-not-defined/#post-13581682)
 * Hi [@jaimemarchwinski](https://wordpress.org/support/users/jaimemarchwinski/),
 * Thank you.
 * Yes, we’ve updated our website to TEC 5.2.1. Still experiencing the **DateFormatter**
   issue as described above.
 * We’ll share our system info if we run into a performance or functional issue 
   caused by the DateFormatter error.
 * Meanwhile, would be great if your developers can look at the files listed below
   and confirm that the DateFormatter function is properly defined. Not a coder 
   but, by comparison with other files, it appears it’s not.
 * My assumption is your seasoned developers can glance at the files and spot the
   error (if any) pretty quick.
 * Thank you!
 * `/wp-content/plugins/the-events-calendar/src/resources/js/events-dynamic.js`
 * `/wp-content/plugins/the-events-calendar/src/resources/js/events-dynamic.min.
   js`
 *  [Jaime](https://wordpress.org/support/users/jaimemarchwinski/)
 * (@jaimemarchwinski)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/uncaught-referenceerror-dateformatter-is-not-defined/#post-13581984)
 * Hi [@jetxpert](https://wordpress.org/support/users/jetxpert/)
 * Thanks for your response. Can you send me a link to your site so I can see the
   error in your console?
 * I’m trying to see if this is something occurring on all sites or is an isolated
   incident.
 * Thanks,
    Jaime
 *  [Eugene Kyale](https://wordpress.org/support/users/eugenetribe/)
 * (@eugenetribe)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/uncaught-referenceerror-dateformatter-is-not-defined/#post-13698132)
 * There’s been no movement on this ticket for more than a week, so I’m going to
   close it as resolved.
 * If you still need assistance with this, please open a new ticket and we’ll be
   happy to help.
 * Cheers,
    Eugene.
 *  [semonbright](https://wordpress.org/support/users/semonbright/)
 * (@semonbright)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/uncaught-referenceerror-dateformatter-is-not-defined/#post-13925642)
 * If you are using any script file and getting “Uncaught ReferenceError:” which
   means ‘x’ is either a variable or a method which you are trying to use before
   declaring it using var keyword. This means that there is a non-existent variable
   referenced somewhere. This variable needs to be declared, or you need to make
   sure it is available in your current script or scope otherwise , it will endup
   throwing this ‘x’ is not defined error . This usually indicates that your library
   is not loaded and JavaScript does not recognize the ‘x’.
 * **To solve this error:** Load your library at the beginning of all your scripts.
 * There can be multiple other reasons for this issue:
 * **Path to [CDN](http://net-informations.com/jq/intro/cdn.htm) library you included
   is not correct
    **The library file is corrupted **Working offline **Conflict 
   with Other Libraries

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

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

 * ![](https://ps.w.org/the-events-calendar/assets/icon-256x256.gif?rev=2516440)
 * [The Events Calendar](https://wordpress.org/plugins/the-events-calendar/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/the-events-calendar/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/the-events-calendar/)
 * [Active Topics](https://wordpress.org/support/plugin/the-events-calendar/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/the-events-calendar/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/the-events-calendar/reviews/)

## Tags

 * [Console error](https://wordpress.org/support/topic-tag/console-error/)
 * [ReferenceError](https://wordpress.org/support/topic-tag/referenceerror/)
 * [TEC](https://wordpress.org/support/topic-tag/tec/)
 * [uncaught](https://wordpress.org/support/topic-tag/uncaught/)

 * 14 replies
 * 5 participants
 * Last reply from: [semonbright](https://wordpress.org/support/users/semonbright/)
 * Last activity: [5 years, 4 months ago](https://wordpress.org/support/topic/uncaught-referenceerror-dateformatter-is-not-defined/#post-13925642)
 * Status: resolved