{"record":{"id":"8d9f307c1d088d2d","repo":"slint-ui/slint","slug":"duplicated-property-name-propname-on-global-g","errorCode":null,"errorMessage":"Duplicated property name ${propName} on global ${global}","messagePattern":"Duplicated property name (.+?) on global (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"api/node/typescript/index.ts","lineNumber":522,"sourceCode":"                    if (componentHandle[jsName] !== undefined) {\n                        console.warn(\n                            \"Duplicated property name \" +\n                                globalName +\n                                \" (In JS: \" +\n                                jsName +\n                                \")\",\n                        );\n                    } else {\n                        const globalObject = Object.create({});\n\n                        instance!\n                            .definition()\n                            .globalProperties(globalName)\n                            ?.forEach((prop) => {\n                                const propName = translateName(prop.name);\n\n                                if (globalObject[propName] !== undefined) {\n                                    console.warn(\n                                        \"Duplicated property name \" +\n                                            propName +\n                                            \" on global \" +\n                                            global,\n                                    );\n                                } else {\n                                    Object.defineProperty(\n                                        globalObject,\n                                        propName,\n                                        {\n                                            get() {\n                                                return instance!.getGlobalProperty(\n                                                    globalName,\n                                                    prop.name,\n                                                );\n                                            },\n                                            set(value) {\n                                                instance!.setGlobalProperty(","sourceCodeStart":504,"sourceCodeEnd":540,"githubUrl":"https://github.com/slint-ui/slint/blob/bb937076de3f7919766c1f25e2e969367cf77e9a/api/node/typescript/index.ts#L504-L540","documentation":"For each exported global, loadFile/loadSource exposes its declared properties on the global's JS object. If a translated property name already exists on that global object (collision with another property, callback, function, or built-in), the property is skipped and this warning is printed; the property will be missing under the expected name.","triggerScenarios":"Calling loadFile() or loadSource() on a project where a global singleton declares two properties translating to the same JS name, or a property named like an existing member of the global object.","commonSituations":"Case-only duplicates inside a global (e.g. 'max-count' and 'maxCount'); properties named 'value', 'toString', or other Object.prototype members that are !== undefined on the wrapper.","solutions":["Rename the colliding property inside the global's .slint declaration","Use the warning text (propName and global name) to locate and de-duplicate the declaration","Read/write the property via instance.global(name).getProperty/setProperty equivalents on the raw instance if renaming is not an option"],"exampleFix":"// before (file.slint)\nexport global Theme {\n    property <color> accent-color;\n    property <brush> accentColor; // collides\n}\n// after (file.slint)\nexport global Theme {\n    property <color> accent-color;\n    property <brush> accent-brush;\n}","handlingStrategy":"validation","validationCode":"const g = instance.global(globalName);\nconst jsNames = globalProps.map(p => translateName(p.name));\nconst dupes = jsNames.filter((n, i) => jsNames.indexOf(n) !== i);\nif (dupes.length) throw new Error(`Duplicate props on ${globalName}: ${dupes}`);","typeGuard":"function globalPropertyReadable(globalObj, propName) {\n  return globalObj[propName] !== undefined;\n}","tryCatchPattern":null,"preventionTips":["Avoid case-only-differing property names inside globals","Avoid Object.prototype member names ('value', 'toString') for global properties","Check generated globals for name collisions after camelCase translation"],"tags":["nodejs","typescript","globals","naming-collision"],"backgroundTag":"invalid-identifier","analyzedSha":"bb937076de3f7919766c1f25e2e969367cf77e9a","analyzedAt":"2026-09-16T01:37:20.251Z","contentChangedAt":"2026-09-16T01:37:20.251Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}