Skip to content

Keycloak import in TypeScript without allowSyntheticDefaultImports #9045

@istvandesign

Description

@istvandesign

Describe the bug

When using

import * as Keycloak from 'keycloak-js';

const keycloak = Keycloak({

I receive
Type '{ default: (config?: string | KeycloakConfig | undefined) => KeycloakInstance; }' has no call signatures.

Version

15.0.2

Expected behavior

One should be able to import Keycloak and use it with TypeScript without turning on allowSyntheticDefaultImports.

Actual behavior

TS2349: This expression is not callable.
Type '{ default: (config?: string | KeycloakConfig | undefined) => KeycloakInstance; }' has no call signatures.

How to Reproduce?

Import keycloak with import * as Keycloak from 'keycloak-js';

Anything else?

Suggested solution: Export like any other library in 2021 by exporting all functions individually as modules and with a default export.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions