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.

Cannot read property 'registerCallbacks' of undefined

See original GitHub issue


I am using NativeScript with Angular and Typescript. When I load the component which implements LocalNotifications.addOnMessageReceivedCallback or attempt to schedule a notification, I get a console error:

ERROR TypeError: Cannot read property ‘registerCallbacks’ of undefined NovenaScheduleComponent_Host.ngfactory.js? [sm]:1

My component: novena-schedule.component.ts

My template: novena-schedule.component.html

My whole project is here

Any help would be greatly appreciated. I am fairly new to all this so any I would be grateful for any requests for clarification, logs, etc.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:2
  • Comments:16 (3 by maintainers)

github_iconTop GitHub Comments

kdanieladamscommented, Oct 20, 2018

I ran into a similar issue with a fresh install in a previously established project. I’m using a local build. Running tns platform clean followed by tns build android resolved the problem.

Maybe just update the docs to note that a platform clean is necessary to get it working.

EddyVerbruggencommented, Oct 20, 2018

That’s required for every plugin that uses native libs. Not sure what the best approach would be. Perhaps an automatic clean after adding the plugin would help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property of undefined when calling method as a ...
the problem is when I access my method using callback from table component (Child) I got undefined. but when I try to move...
Read more >
Getting "Cannot read property '0' of undefined" exception ...
I am having the exception “Cannot read property '0' of undefined” while using Custom Database Create Action Script.
Read more >
Creator 2.x - Cocos中文社区
请问哪位大佬知道是啥问题?微信小游戏报错VM20:202 gameThirdScriptError Cannot read property '_owner' of undefined;at setTimeout callback f…
Read more >
Class: AWS.Request — AWS SDK for JavaScript
For example, the following service method returns the request object as "request", which can be used to register callbacks: // request is an...
Read more >
Cannot read property 'mode' of undefined | 微信开放社区 - 腾讯
registerCallback.t ... Cannot read property 'mode' of undefined;at api onAppEnterBackground callback function. TypeError: Cannot read ...
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 Post

No results found

github_iconTop Related Hashnode Post

No results found