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.

Tooltip _unregisterListenersFn error

See original GitHub issue

Bug description:

I’m using NgbTooltip with a variable translated string (with NgxTranslate but according to my tests it has no impact on the error) :

<button class="btn btn-lg btn-hidden"
        placement="top"
        ngbTooltip="{{ bookmarkId ? 'UNFOLLOW' : 'FOLLOW' | translate }}"
        (click)="toggle()"
        *ngIf="!bookmarkId">
  <i class="icon" [ngClass]="{'icon-star text-color-yellow': bookmarkId, 'icon-star_border': !bookmarkId}"></i>
</button>

Which throw this error : ERROR TypeError: this._unregisterListenersFn is not a function at NgbTooltip.ngOnDestroy (tooltip.js:141) at callProviderLifecycles (core.js:12697) at callElementProvidersLifecycles (core.js:12658) at callLifecycleHooksChildrenFirst (core.js:12641) at destroyView (core.js:14007) at callViewAction (core.js:14158) at execComponentViewsAction (core.js:14070) at destroyView (core.js:14006) at callWithDebugContext (core.js:15041) at Object.debugDestroyView [as destroyView] (core.js:14592)

Thanks for your help !

Version of Angular, ng-bootstrap, and Bootstrap:

Angular CLI: 1.6.4 Node: 8.9.4 OS: darwin x64 Angular: 5.2.0 @angular/cli: 1.6.4 @angular-devkit/build-optimizer: 0.0.37 @angular-devkit/core: 0.0.24 @angular-devkit/schematics: 0.0.45 @ngtools/json-schema: 1.1.0 @ngtools/webpack: 1.9.4 @schematics/angular: 0.1.12 typescript: 2.4.2

ng-bootstrap: 1.0.0-beta.6

Bootstrap: 4.0.0-beta.2

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
bygrace1986commented, Mar 1, 2018

@pkozlowski-opensource I just ran into the same issue. My scenario is that I attach a custom structural directive to an element that also has the tooltip directive on it. The structural directive has multiple parameters and evaluates whether to create or destroy the view when each parameter is set. This can cause the view to be created and destroyed quickly. It is quick enough that ngOnInit has not had time to run on the tooltip directive before ngOnDestroy has run. So _unregisterListenersFn is undefined and I get the error this._unregisterListenersFn is not a function. Just wraping the _unregisterListenersFn in a null check should do the trick.

Here is a working (or rather not working) example: https://stackblitz.com/edit/acl-directive

0reactions
bygrace1986commented, Mar 1, 2018
Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught TypeError: $(...).tooltip is not a function error
You are getting the error because jquery-ui is loaded after your script is executed. you can try to add type="text/javascript" to your ...
Read more >
CM Tooltip (CMTG) - Troubleshooting - 404 Errors
Simply put, a 404 error can happen when you try to access a link, but the server can't find it. Tooltip Glossary creates...
Read more >
Error with tooltips. - SAPIEN Forums
I added a tooltip component with the default name "tooltip1". Clicked on a textbox and in the Misc. properties added the text "Stuff"...
Read more >
Can we make a tooltip as error message? - UX Stack Exchange
I have a form wich contains some fields,when the user leaves one of these fields empty,I change the border color to red and...
Read more >
JavaScript Problem: Creating a JavaScript Tooltip: Part 2
In this part 2 tutorial, we finish up our JavaScript tooltip. In the process we implement several important JavaScript concepts including ...
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