roblox-tsr
roblox-ts3mo ago
2 replies
kv_

Invalid attribute

I have a component which takes an attribute "acoustic_zone", the type of which is;
// component
acoustic_zone: Exclude<keyof typeof Workspace.AcousticZones, keyof Folder>;

// declaration
interface Workspace extends Instance {
    AcousticZones: Folder & {
        Nightclub: Part;
        TestZone: Part;
        env: Part;
    };
}


This is compiled as a literallist:
Reflect.decorate(WorldAudioEmitter, "$c:components@Component", Component, { {
    tag = "WorldAudioEmitter",
    attributes = {
        audio = t.string,
        scope = t.number,
        acoustic_zone = t.literalList({ "Nightclub", "TestZone", "env" }),
        volume = t.number,
    },
    instanceGuard = t.instanceIsA("BasePart"),
} })


Below I have attached a debugger screenshot, the attribute is a string, has the correct key, and is one of the literals. Attached as well is the error
image.png
image.png
image.png
Was this page helpful?