Having trouble accessing the "emit" property of an undefined element within the navLinks FullCalendar component in Angular

While incorporating full-calendar from fullcalendar.io into my Angular project, I made sure to install all necessary plugins like dayGrid, timeGrid, and interaction. Utilizing navLinks functionality, I came across this resource -> https://fullcalendar.io/docs/navLinks, and also found a similar solution here: https://stackblitz.com/edit/angular-7chhen?file=src%2Fapp%2Fapp.component.html. However, in the latter example, navLinks seemed to be functioning correctly.


Here's a snippet of my code:
HTML code ->

<full-calendar
    #calendar
    ...
    [navLinks]="true"
    (navLinkDayClick)="navLinkDayClick($event)"
    (navLinkWeekClick)="navLinkDayClick($event)"
></full-calendar>

In the component class ->

...
calendarPlugins = [dayGridPlugin, timeGrigPlugin, interactionPlugin, bootstrap];
...
navLinkDayClick(date){
    console.log('day');
}

navLinkWeekClick(date){
    console.log('week');
}

When clicking on a date, I encounter the following error ->

ERROR TypeError: Cannot read property 'emit' of undefined
    at options.<computed> (fullcalendar-angular.js:303)
    at HTMLAnchorElement.<anonymous> (main.esm.js:6622)
    at HTMLElement.realHandler (main.esm.js:379)
    at ZoneDelegate.invokeTask (zone-evergreen.js:391)
    at Object.onInvokeTask (core.js:32819)
    at ZoneDelegate.invokeTask (zone-evergreen.js:390)
    at Zone.runTask (zone-evergreen.js:168)
    at ZoneTask.invokeTask [as invoke] (zone-evergreen.js:465)
    at invokeTask (zone-evergreen.js:1603)
    at HTMLElement.globalZoneAwareCallback (zone-evergreen.js:1629) defaultErrorLogger @ core.js:4799 handleError @ core.js:4851 next @ core.js:33552 schedulerFn @ core.js:29522
__tryOrUnsub @ Subscriber.js:183 next @ Subscriber.js:122
_next @ Subscriber.js:72 next @ Subscriber.js:49 next @ Subject.js:39 emit @ core.js:29484 (anonymous) @ core.js:32877 invoke @ zone-evergreen.js:359 run @ zone-evergreen.js:124 runOutsideAngular @ core.js:32764 onHandleError @ core.js:32874 handleError @ zone-evergreen.js:363 runTask @ zone-evergreen.js:171 invokeTask @ zone-evergreen.js:465 invokeTask @ zone-evergreen.js:1603 globalZoneAwareCallback @ zone-evergreen.js:1629

Additionally, here are the dependencies in package.json ->

"@fullcalendar/angular": "^4.3.1",
"@fullcalendar/bootstrap": "^4.3.0",
"@fullcalendar/core": "^4.3.1",
"@fullcalendar/daygrid": "^4.3.0",
"@fullcalendar/interaction": "^4.3.0",
"@fullcalendar/list": "^4.3.0",
"@fullcalendar/luxon": "^4.3.0",
"@fullcalendar/moment": "^4.3.0",
"@fullcalendar/moment-timezone": "^4.3.0",
"@fullcalendar/timegrid": "^4.3.0",

module ->

@NgModule({
  imports: [
    ...
    FullCalendarModule
  ],
  declarations: [
    ...
    UsersWorkCalendarComponent,
  ],
  entryComponents: [
    ...
    UsersWorkCalendarComponent,
  ]
})
export class DashboardModule { }

Answer №1

This error is the most recent version. You can find more information about it in this closed issue on GitHub, but it is still reproducible in version 4.3.1.

It might be helpful to consider downgrading to version 2.4.1, which is the version being used in your StackBlitz. This particular issue seems to be recurring based on the comments in the GitHub issues and related links.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Check the schedule for any upcoming events

I am currently designing a website for a friend and I have a question regarding the functionality of the FullCalendar jQuery plugin. Is there a way to determine if there is an event scheduled for today using FullCalendar? If so, I would like to display t ...

Exploring the functionality of CanDeactiveGuard and ModalDialogService through unit testing

In my application, the CanDeactiveGuard is functioning properly. During unit testing, I encountered an issue with one test where I intended to use callThrough to invoke the openConfirmDialog() method within the Guard. This method triggers the Modal Dialog ...

Encountered Error: Unable to locate the module 'url' within webpack version 5 and Angular version 14

Encountering an error while working on a project in Angular 14 with [deepstream.io-client-js][1] installed. See the issue below. [1]: https://www.npmjs.com/package/deepstream.io-client-js A notable change has occurred: webpack < 5 previously included ...

gather and handle data from the shared interface between different parts

I have two different paths. One is for products and the other is for products-cart. I want to use a shared ts file for both to store the product and cart information in an array. However, I am encountering an issue. I am unable to make any changes or trans ...

Angular - Utilizing FormArrayName within child components

There are three main components involved: consent consent-scope-list consent-scope-item consent includes a FormGroup that houses two FormArrays. consentForm = this.fb.group({ identityScopes: this.fb.array([]), resourceScopes: this.fb.array([]) }); ...

Exploring SubjectBehavior within my UserService and Profile Component

Within my ShareService, I have the following code snippet: isLogin$:BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false); <==== default value is false CheckUser = this.isLogin$.asObservable(); public isLogin (bool){ ...

Validation failures frequently occur in the typeahead feature of Angular 2 when using Bootstrap 4, despite a value being selected

I need to implement an auto-complete feature using Bootstrap Typeahead in a form I am currently working on. <input [(ngModel)]="model.brand" [typeahead]="model.brands" ng-model-options="{'updateOn': 'blur'}" (typeaheadOnSele ...

Is there a similar feature to RxJs version 4's ofArrayChanges in RxJs version 5?

Currently utilizing Angular2 and attempting to monitor changes in an array. The issue lies with only having RxJs5 available, which appears to lack this specific functionality. ...

Tips for setting up Typescript to deduce discriminated unions when `is` and `never` are included in the code

In the past, I had a library included in my project that I later removed (deleted from package.json). However, this library had a peer dependency on fp-ts, so I had to directly add fp-ts to my project. The fp-ts library includes an Either type which allows ...

Tips for deleting a specific choice with Angular

Having recently started working with Angular2 / TS / ES6, I am struggling to find a solution to my issue. I have a select element with dynamically rendered options using ngFor from an array. These options are meant for selecting attributes for a product. ...

Error: Angular router outlet could not find any matching routes for the requested

I have been working on an application that utilizes lazy-loaded modules for each main section of the app. In one module, I have two router outlets - a primary one and one called details. const routes: Routes = [ { path: '', component: BooksCo ...

Encountered an issue launching the advanced web server and reverse proxy server nginx for high performance

UPDATE - Recently, I encountered the following error logs: nginx: [emerg] unknown "request_url" variable Aug 19 01:14:58 nginx[4890]: nginx: configuration file /etc/nginx/nginx.conf test failed Below is my nginx.conf file: user www-data; worker ...

Developing applications with Angular 4 and AppInventor window

Currently, I have a local Angular 4 application that utilizes localStorage on a desktop browser for data persistence. Within the application, I have implemented a WebViewer in AI. It is clear that localStorage cannot function in AI2, so alternative data s ...

Angular Toaster Notification - There are currently no toaster containers set up to display notifications

Currently, I am utilizing the angular2-toaster library within my Angular application. It is quite straightforward - you simply define a toaster container in the template of your component: <toaster-container></toaster-container> Then, you ca ...

Utilizing Jest and nest.js for testing with absolute paths

Looking at my jest configuration inside the package.json: "jest": { "moduleFileExtensions": [ "js", "json", "ts" ], "moduleDirectories":["node_modules", "src" ...

Exploring the Angular 2 Framework by Streaming Data from a RESTful API

Is it possible to easily handle a continuously streaming data feed in angular2? I am working on a chat application with a server written in go and a client implemented in angular2. To enable real-time updates, I have set up an endpoint that maintains the c ...

Is there a way to ensure that the onChange event of ionic-selectable is triggered twice?

I've been working with an ionic app that utilizes the ionic-selectable plugin, and for the most part, it's been running smoothly. However, I encountered a rare scenario where if a user on a slow device quickly clicks on a selection twice in succe ...

Guide on creating proxy functions with parameter tuples for complex functions in TypeScript

I am currently in the process of converting a JavaScript library to TypeScript and need to define proxy functions. These functions should be able to accept any type and number of parameters and pass them to the original function like so: async function any ...

How can a custom event bus from a separate account be incorporated into an event rule located in a different account within the CDK framework?

In account A, I have set up an event rule. In account B, I have a custom event bus that needs to act as the target for the event rule in account A. I found a helpful guide on Stack Overflow, but it was specific to CloudFormation. I am providing another a ...

Is it feasible to utilize AngularFire and Firebase in tandem?

Currently, I am working with Ionic2 and firebase. There are two methods to initialize firebase in app.ts that I have come across. I am wondering which one is the recommended approach and how can both functions be utilized together? When I initialized fireb ...