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.

no exported member 'KeycloakConfig'.

See original GitHub issue

Bug Report or Feature Request (mark with an x)

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

Versions.

keycloak-angular: 7.3.1 --> 8.0.1 angular: 10 (recently upgraded from 8.2, but had successful builds after upgrade to 10) keycloak: Believed to be N/A for current issue.

Repro steps.

  1. Write application code.
  2. Start on version 7.3.1 of keycloak angular
  3. Run npm outdated and note that Latest is 8.0.1
  4. Change package.json’s dependency from "keycloak-angular": "7.3.1" to "keycloak-angular": "8.0.1"
  5. Run npm install
  6. Run ng test

Sample code snippets

import { KeycloakConfig } from 'keycloak-angular';

@Injectable()
export class AppConfig {
  static keycloak: KeycloakConfig;
}
export class KeycloakCallsService {
  readonly baseApiUrl: string = `${AppConfig.keycloak.url}/admin/realms/${AppConfig.keycloak.realm}`;
export class MockAppConfig {
    static keycloak: KeycloakConfig = {
      url: 'testKeycloakUrl',
      realm: 'testKeycloakRealm',
      clientId: 'testKeycloakClientId'
    };
  }

The log given by the failure.

ERROR in src/app/application/app.config.spec.ts:1:10 - error TS2305: Module '"../../../node_modules/keycloak-angular/keycloak-angular"' has no exported member 'KeycloakConfig'.

1 import { KeycloakConfig } from 'keycloak-angular';
           ~~~~~~~~~~~~~~
src/app/application/app.config.ts:3:10 - error TS2305: Module '"../../../node_modules/keycloak-angular/keycloak-angular"' has no exported member 'KeycloakConfig'.

3 import { KeycloakConfig } from 'keycloak-angular';
           ~~~~~~~~~~~~~~

Desired functionality.

Keycloak-Angular 8.0.1 works with our application so that we can remain up-to-date with functionality and security. If there are release notes regarding the upgrade from 7 to 8, I haven’t been able to find them yet.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
mrsegencommented, Jul 28, 2020

It seems that the KeycloakConfig interface was defined within this package in 7.3.1 but at least of 8.0.1, while an identically-named interface is still used, it is instead imported from the keylcoak-js adapter node module.

To get tests to pass, I changed

import { KeycloakConfig } from 'keycloak-angular';

to

import { KeycloakConfig } from 'keycloak-js';

However, other parts of the application that depend on Keycloak fail to work afterthis.

1reaction
jonkoopscommented, Jul 28, 2020

This is indeed a breaking change we introduced in version 8. These types have since been added to keycloak-js and should be imported there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Namespace as no exported member 'ɵɵNgModuleDeclaration'
Hi!, I use Angular 11 and I would update keycloak-angular from version 8.2.0 to 9.0.0, but after installed new version and run application ......
Read more >
Angular2 module has no exported member - Stack Overflow
module"' has no exported member 'SigninComponent'. even after exporting SigninComponent. The project folder structure is as shown below: enter ...
Read more >
Module '"@prismicio/client"' has no exported member 'Content'
As title states, I'm getting this error: This is my prismic.ts: import * as prismic from '@prismicio/client'; import * as prismicNext from ...
Read more >
keycloak-angular - npm
Easy Keycloak setup for Angular applications. Latest version: 13.0.0, last published: a month ago. Start using keycloak-angular in your ...
Read more >
Connecting Keycloak to Angular - Medium
export class KeycloakService { ... keycloakAuth = new Keycloak(config); ... keycloak.service';export function kcFactory(keycloakService: ...
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