Cannot read properties of null (reading getTime)

Hello!

I am building a component using the Syncfusion React Schedule. I followed the exactly same steps from the documentation and video tutorial. I was able to implement it fine.

There is an issue that I didnt find while testing and running the sample in the page and it is happening in my application.

If I clear the dates within the inputs of Start/End date, click the checkbox All day, in the Sample within the documentation in the page https://ej2.syncfusion.com/react/documentation/schedule/getting-started I get no error.

But in my application, the component I built, if I clear the dates from the date fields, and I click the checkbox, I get the error:

Cannot read properties of null (reading 'getTime')

TypeError: Cannot read properties of null (reading 'getTime')

    at EventWindow.updateDateTime (http://localhost:3000/static/js/vendors-node_modules_syncfusion_ej2-react-schedule_src_schedule_schedule_component_js-node_mo-b3f1d8.chunk.js:19291:109)

    at EventWindow.onAllDayChange (http://localhost:3000/static/js/vendors-node_modules_syncfusion_ej2-react-schedule_src_schedule_schedule_component_js-node_mo-b3f1d8.chunk.js:19279:12)

    at EventWindow.onChange (http://localhost:3000/static/js/vendors-node_modules_syncfusion_ej2-react-schedule_src_schedule_schedule_component_js-node_mo-b3f1d8.chunk.js:18982:14)

    at Observer.notify (http://localhost:3000/static/js/vendors-node_modules_syncfusion_ej2-buttons_src_check-box_check-box_js-node_modules_syncfusio-1818e3.chunk.js:8879:21)

    at CheckBox.trigger (http://localhost:3000/static/js/vendors-node_modules_syncfusion_ej2-buttons_src_check-box_check-box_js-node_modules_syncfusio-1818e3.chunk.js:996:37)

    at CheckBox.clickHandler (http://localhost:3000/static/js/vendors-node_modules_syncfusion_ej2-buttons_src_check-box_check-box_js-node_modules_syncfusio-1818e3.chunk.js:11302:10)


Why would I get this error if my implementation follows the exactly same code?

Thanks for the help.

Here is my code:

import {
  Inject,
  ScheduleComponent,
  Day,
  Week,
  WorkWeek,
  Month,
  Agenda,
} from "@syncfusion/ej2-react-schedule";
import { registerLicense } from "@syncfusion/ej2-base";

const ScheduleTab = () => {
  const licenseKey = process.env.REACT_APP_SYNCFUSION_LICENSE_KEY as string;
  registerLicense(licenseKey);

  return (
    <ScheduleComponent>
      <Inject services={[Day, Week, WorkWeek, Month, Agenda]} />
    </ScheduleComponent>
  );
};

export default ScheduleTab;


4 Replies 1 reply marked as answer

SS Saritha Sankar Syncfusion Team April 23, 2025 07:01 AM UTC

Hi Braulio Portela,

Your reported problem is considered a bug. The fix for this defect will be included in our upcoming weekly patch release, which is expected to be rolled out by May 13, 2025. You can track the status of the fix at the following link:


Feedback:  Cannot read properties of null (reading 'getTime') in React | Feedback Portal


Disclaimer: Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.


Regards,

Saritha S.



BP Braulio Portela April 23, 2025 11:20 AM UTC

Hello Saritha!


Thanks for the reply. My solution for now was make the clear button to be hidden, since if I manually delete the date and click the checkbox, the error doesn't occur.


I will be looking forward to the patch release.


Thanks!


EDITED: I've just noticed your steps to reproduce the error. You said:

  • Clear the Start Date and End Date fields manually.

When I clear manually the error doenst occur, it is only when I click the clear "X" button.



RV Ravikumar Venkatesan Syncfusion Team April 24, 2025 03:07 PM UTC

Hi Braulio Portela,

Thank you for your continued updates. Based on the latest information, we've updated the existing bug report to specify that the issue only occurs when using the clear "X" button.

We appreciate your patience as we work on a patch to resolve this specific issue. We will keep you updated with any progress and specifically update you about the status of the issue fix on May 13, 2025.

Regards,
Ravikumar Venkatesan



SS Saritha Sankar Syncfusion Team May 15, 2025 05:31 AM UTC

Hi Braulio,


We are glad to announce that our weekly release (V29.2.4) has been rolled out successfully. The fix for the issue has been included in our weekly release(29.2.4). Upgrade to the latest version to resolve the issue.

Release notes: Essential Studio for React 2025 Volume 1 Service Pack Release Release Notes


Feedback: Cannot read properties of null (reading 'getTime') in React | Feedback Portal


Root Cause: The issue occurred because null checks were not implemented for the start and end date values. As a result, attempting to access them caused a null reference exception during runtime.


We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.


Regards,

Saritha S.


Marked as answer
Loader.
Up arrow icon