octobercms/october · error · Error

showConfirm options.isDanger must be Boolean

Error message

showConfirm options.isDanger must be Boolean

What it means

Type guard in ModalUtils.showConfirm: options.isDanger is supplied but is not a boolean. The flag switches the confirm dialog to its destructive/danger styling and semantics, so it only accepts true/false.

Solutions

  1. Pass isDanger as an explicit true or false, or omit it
  2. Wrap computed flags in Boolean(...) before adding them to the options object
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at modules/backend/vuecomponents/modal/assets/js/classes/utils.js:111 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21). Data as JSON: /api/errors/a5a68c4b33aeeea4. Report an issue: GitHub.

Appendix: source

Thrown at modules/backend/vuecomponents/modal/assets/js/classes/utils.js:111

                        }
                    },
                    onCloseClick(button) {
                        buttonClicked = true;
                        resolve(button);
                    }
                }
            });

            app.mount(wrapperEl);
        });
    }

    showConfirm(title, text, options) {
        options = this.#validateAlertOptions(options);
        this.#validateBasicArguments(title, text);

        if (options.isDanger !== undefined && typeof options.isDanger !== 'boolean') {
            throw new Error('showConfirm options.isDanger must be Boolean');
        }

        return new Promise((resolve, reject) => {
            // Create container element for Vue app
            const wrapperEl = document.createElement('div');
            document.body.appendChild(wrapperEl);

            let buttonClicked = false;

            // Create Vue 3 app
            const app = oc.createVueApp({
                data() {
                    return {
                        title: title,
                        text: text,
                        isDanger: options.isDanger,
                        buttonText: options.buttonText,
                        size: options.size || 'normal'

View on GitHub (pinned to b608633a7e)