I've gone through previous posts like this for the uncaught typeerror, but all of them are referencing the order in which the scripts are loaded. Since I'm using wordpress, the order is as such:
wp_enqueue_script( 'google-jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js'); wp_enqueue_style('icons', 'https://i.icomoon.io/public/8f231b5d70/healthprofessionaltheme/style.css'); wp_enqueue_style('fonts', 'https://fonts.googleapis.com/css?family=Merriweather:700|Roboto:400,700&display=swap'); wp_enqueue_style('calendar-core-css', get_template_directory_uri() . '/assets/fullcalendar/packages/core/main.min.css'); wp_enqueue_script( 'calendar-core-js', get_template_directory_uri() . '/assets/fullcalendar/packages/core/main.min.js'); wp_enqueue_style('calendar-daygrid-css', get_template_directory_uri() . '/assets/fullcalendar/packages/daygrid/main.min.css'); wp_enqueue_script( 'calendar-daygrid-js', get_template_directory_uri() . '/assets/fullcalendar/packages/daygrid/main.min.js'); wp_enqueue_style('calendar-timegrid-css', get_template_directory_uri() . '/assets/fullcalendar/packages/timegrid/main.min.css'); wp_enqueue_script( 'calendar-timegrid-js', get_template_directory_uri() . '/assets/fullcalendar/packages/timegrid/main.min.js'); wp_enqueue_script( 'calendar-interaction', get_template_directory_uri() . '/assets/fullcalendar/packages/interaction/main.min.js'); wp_enqueue_style( 're_admin_core', get_template_directory_uri() . '/assets/stylesheets/admin_core.css'); Where the calendar JS load is first, with other plugins to follow.
The error shows only when I click on the event within this function:
eventClick: function(info){ var event_id = info.event.id; event_selected = event_id; var similarEvents = info.event; similarEvents.className = 'is_selected'; $("#calendar").fullCalendar('updateEvent', similarEvents); //The issue } I've tried removing the jQuery line and replacing it with document.getElementById("calendar") and the problem is the exact same. Why is that the case? Is it because how I call the fullCalendar reference at the top which is this?
var calendarEl = document.getElementById('calendar'); var calendar = new FullCalendar.Calendar(calendarEl, {...}); I know when I attempted to replace the calendar variable with $("#calendar").fullCalendar({..}); it threw the exact same error at the top. Are the newer versions of fullCalendar moved away from this function?