-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Injecting Keycloak from 'keycloak-js' throws NullInjectorError #616
Comments
Hey @JeyKeu, This error usually occurs when a service or dependency is being injected in a context where it hasn't been provided or is no longer available. Since this is happening during logout, it’s worth checking how and where the logout process is being triggered. I’d recommend reviewing the relevant code to better understand the issue and comparing it with the approach used in the |
What's your |
Hey @mauriciovigolo, sorry for the late reply. I was on vacation for 2 weeks. please note that I'm only importing Keycloak from 'keycloak-js' in my logout component that's why I'm getting the error there. I guess the main issue here is that I am loading keycloak dynamically (fetching config from BE), which I believe is not supported yet by
@goldmont thanks for mentioning that, but I had it already there. |
keycloak-js supports loading configuration from a remote URL.
Source: Keycloak JavaScript Adapter Documentation However, the current ProvideKeycloakOptions type does not allow passing a string to the config parameter—it only accepts a KeycloakConfig object. |
I have an angular application where I'm initialising keycloak using the following:
everything seems to work fine. My issue is when I try to logout, I'm injecting Keycloak following this example from your docs but I'm getting:
any idea how I can fix that?
Thanks!
The text was updated successfully, but these errors were encountered: