question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ERROR TypeError: Cannot read property 'getApi' of undefined

See original GitHub issue

what’s the problem?

ERROR TypeError: Cannot read property ‘getApi’ of undefined

this.fullcalendar.getApi().refetchEvents();

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
makkaronis4ecommented, Jul 17, 2019

Im not sure that i fully understood your approach. But id reccomend you to call this method inside ngAfterViewInit. You can reach this api only after your component finishes rendering calendar

ngAfterViewInit(): void { this.calendarApi = this.calendarComponent.getApi(); }

2reactions
rjs123431commented, Dec 19, 2019

try to enclose it inside settimeout

getCalendarApi() {
        setTimeout(() => {
            this.calendarApi = this.monthFullCalendar.getApi();
        });
    }
Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript - Cannot read properties of null (reading 'getApi') in ...
It seems that you are setting a timeout which has no time associated, so it will run immediately. It tries to get the...
Read more >
Uncaught TypeError: Cannot read property 'get' of undefined
Hi, very new to Laravel Spark here. I downloaded the sample Code with Tasks & Activity from Spark Demo. I know this demo...
Read more >
Problem on edit LDAP settings after set setting by extra_settings
... I have this error "TypeError: Cannot read properties of undefined (reading 'default')" No logs in "web container", just " "GET /api/v2/settings/ldap/ ...
Read more >
[FullCalendar Reactive] Error "Cannot read property ...
I'm receiving this error and calendar is not showing: "Cannot read property 'getUTCFullYear' of ... [Error] TypeError: null is not an object (evaluating...
Read more >
TypeError: Cannot read properties of undefined (reading 'filter ...
Coding example for the question TypeError: Cannot read properties of undefined (reading 'filter') when array is coming from a get api-node.js.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found