function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jess RobinsonJess Robinson 

Cannot create Event in scratch org

I am trying to create an Event in a scratch org and am receiving this error:
Data Not Available
The data you were trying to access could not be found. It may be due to another user deleting the data or a system error. If you know the data is not deleted but cannot access it, please look at our support page. 

Creating a task works fine. I get the same error creating an event on both accounts and leads. I tried creating the event via Apex:
Event newEvent = new Event(Subject='Hello', Type='Email', ActivityDateTime=2017-10-18T00:00:00.000Z, DurationInMinutes=5);
insert newEvent;

But that code won't run, with this error:
Line: 1, Column: 7
Unexpected token 'newEvent'.