mauriciovigolo/keycloak-angular

ERROR TypeError: Keycloak is not a function

mauriciovigolo opened this issue · 14 comments

Bug Report or Feature Request (mark with an x)

- [X] bug report -> please search for issues before submitting
- [ ] feature request

Versions.

keycloak-js - 7.0.0
keycloak-angular - 7.0.1

The log given by the failure.

Navigated to http://localhost:4200/
VM1563 vendor.js:229523 [WDS] Live Reloading enabled.
VM1562 scripts.js:901 [KEYCLOAK] Estimated time difference between browser and server is 0 seconds
VM1564 main.js:1077 Keycloak {init: ƒ, login: ƒ, createLoginUrl: ƒ, logout: ƒ, createLogoutUrl: ƒ, …}
VM1564 main.js:889 Trace KEYCLOAK INIT...
VM1563 vendor.js:67924 ERROR TypeError: Keycloak is not a function

keycloak-js@7.0.0 was released 3 days ago. There is something wrong or a change made in the library.
Meanwhile, I recommend sticking on keycloak-js@6.0.1

The error exists in the upstream npm package. It's broken for react as well. The issue on Keycloak's issue tracker: https://issues.jboss.org/browse/KEYCLOAK-11223

Thanks for the info @fishybell.

This looks like a duplicate issue but was created before the issue @fishybell referenced. https://issues.jboss.org/browse/KEYCLOAK-11187

I've opened up a PR to Keycloak that should fix this problem at keycloak/keycloak#6281. While the Keycloak team deals with the review please remain on a Keycloak version < 7 and you should be fine.

The Issue on the Side of Keycloak is closed. So could you update here something?

@danielehrhardt Was it fixed in keycloak client? Was fixed version of keycloak client released? I see still 7.0.0.

The issue has been resolved in Keycloak, however a new release has not yet been published by the Keycloak team.

Thanks, @jonkoops. As soon the new release is available we can change the peer dependencies and publish a new version.

I've requested the Keycloak team make a new release to resolve these issues. You can find more information on the PR (keycloak/keycloak#6279 (comment)) or voice your opinion on the mailing list.

A new release of keycloak-js (7.0.1) has been published that fixes this issue. I've updated the respective PR for adding support for this version as well (see: #154).

Closing this issue as it is a problem in Keycloak itself and it should be possible to update to a working version in Angular Keycloak 7.1.0.

I'm still getting with native promises

TypeError: this._instance.init(...).success is not a function

I have

keycloak-js: 8.0.2
keycloak-angular: 7.1.0

@EfraimLA promiseType: 'native' is not supported by Keycloak Angular. Support for this will be added by Keycloak without breaking changes, see #187.