slint-ui/slint · warning

Duplicated property name ${propName} on global ${global}

Error message

Duplicated property name ${propName} on global ${global}

What it means

Each property of a global is defined on the global's JS object under the camelCase translation of its .slint name. If two members of the same global translate to the same JS key (e.g. item-count and itemCount), the bindings warn 'Duplicated property name <propName> on global <global>' and only the first one is defined - the colliding property silently cannot be read or set from JS.

Source

Thrown at api/node/typescript/index.ts:521

                    if (componentHandle[jsName] !== undefined) {
                        console.warn(
                            "Duplicated property name " +
                                globalName +
                                " (In JS: " +
                                jsName +
                                ")",
                        );
                    } else {
                        const globalObject = Object.create({});

                        instance!
                            .definition()
                            .globalProperties(globalName)
                            ?.forEach((prop) => {
                                const propName = translateName(prop.name);

                                if (globalObject[propName] !== undefined) {
                                    console.warn(
                                        "Duplicated property name " +
                                            propName +
                                            " on global " +
                                            global,
                                    );
                                } else {
                                    Object.defineProperty(
                                        globalObject,
                                        propName,
                                        {
                                            get() {
                                                return instance!.getGlobalProperty(
                                                    globalName,
                                                    prop.name,
                                                );
                                            },
                                            set(value) {
                                                instance!.setGlobalProperty(

View on GitHub (pinned to 3fd8f2ec03)

Solutions

  1. Rename one of the two colliding properties so their camelCase forms differ.
  2. Smoke-instantiate the component after renames and watch for the console warning.
  3. Standardize on one naming style (kebab-case) inside every global.
  4. Diff the generated .d.ts for the global - the shadowed property is absent.

Example fix

// before (.slint): both keys translate to `itemCount`
export global Store {
    out property <int> item-count;
    out property <int> itemCount; // collides
}

// after: unique camelCase keys
export global Store {
    out property <int> item-count;
    out property <int> total-items;
}
Defensive patterns

Strategy: validation

Validate before calling

const globalObj = (instance as any)[jsGlobalName];
for (const p of instance.definition().globalProperties(jsGlobalName) ?? []) {
    const key = p.name.replace(/-(\w)/g, (_, c: string) => c.toUpperCase());
    if (globalObj[key] === undefined) {
        throw new Error(`property "${p.name}" on global "${jsGlobalName}" is shadowed`);
    }
}

Prevention

When it happens

Trigger: Inside one global, declaring property <int> item-count together with property <int> itemCount; a property renamed in .slint while the old spelling is still declared elsewhere in the same global.

Common situations: Incremental kebab-to-camel refactors leaving dual spellings; copy-paste of properties between globals with style adjustments; generated .slint code mixing naming styles.

Related errors


AI-assisted analysis of slint-ui/slint@3fd8f2ec03 (2026-08-19). Data as JSON: /api/errors/8d9f307c1d088d2d. Report an issue: GitHub.