angular-ui / ui-router

The de-facto solution to flexible routing with nested views in AngularJS
http://ui-router.github.io/
MIT License
13.56k stars 3.01k forks source link

hook callback is not a function error #3741

Closed zlasa closed 4 years ago

zlasa commented 5 years ago

I am getting this error when trying to upgrade to angular-ui-router 1.0.20:

TypeError: hook.callback.call is not a function at invokeCallback (..\node_modules\@uirouter\core\lib\transition\transitionHook.js:94) at TransitionHook.invokeHook (..\node_modules\@uirouter\core\lib\transition\transitionHook.js:99) at ..\node_modules\@uirouter\core\lib\transition\transitionHook.js:79 at Array.forEach () at TransitionHook.runAllHooks (..\node_modules\@uirouter\core\lib\transition\transitionHook.js:79) at transitionSuccess (..\node_modules\@uirouter\core\lib\transition\transition.js:584) at processQueue (..\node_modules\angular\angular.js:17330) at ..\node_modules\angular\angular.js:17378 at Scope.$digest (..\node_modules\angular\angular.js:18515) at Scope.$apply (..\node_modules\angular\angular.js:18903)

after putting a breakpoint and observing the callback, i see that it in an array format:

["$transition$", ƒ]

jbcpollak commented 4 years ago

Same issue, did you ever find a solution?

vicneanschi commented 4 years ago

Getting the same error with "@uirouter/angularjs": "^1.0.22". The app doesn't break. Just annoying error message in console. I tried to add onSuccess but this didn't help

$transitions.onSuccess({ }, function(trans) {
        console.log("$transitions.onSuccess", trans);
    });
stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

This does not mean that the issue is invalid. Valid issues may be reopened.

Thank you for your contributions.