Skip to content

Allow throwing errors on deprecation warnings #301

@jonkoops

Description

@jonkoops

Currently, deprecation warnings are emitted via console.warn and silently allow execution to continue. It would be useful to provide a way to make deprecations throw errors instead, so that users can catch deprecated usage paths in their test suites or CI pipelines before upgrading to the next major version.

This could take the form of a static configuration option, e.g.:

import Keycloak from 'keycloak-js';

Keycloak.throwOnDeprecations = true;

or an init option:

keycloak.init({ throwOnDeprecations: true });

When enabled, any call that would normally emit a deprecation warning would instead throw an error, making it easy to surface deprecated usage in automated testing.

Use case

Teams preparing to upgrade from 26.x to 27.0.0 can enable this in their CI environment to identify all deprecated code paths that will break in the next major, without having to manually grep console output for warnings.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/enhancementAn enhancement to an existing feature

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions