R
roblox-ts4d ago
kv_

Infinite yield possible on instance

I can't figure out why the type guard is failing for this component. Class declaration:
interface Instance extends Part {
Part: Part;
}

@Component({ tag: 'AudioQueueDisplay' })
export class WUIC_AudioQueueDisplay extends BaseComponent<{}, Instance> implements OnStart {}
interface Instance extends Part {
Part: Part;
}

@Component({ tag: 'AudioQueueDisplay' })
export class WUIC_AudioQueueDisplay extends BaseComponent<{}, Instance> implements OnStart {}
Compiled typeguard:
Reflect.decorate(WUIC_AudioQueueDisplay, "$c:components@Component", Component, { {
tag = "AudioQueueDisplay",
attributes = {},
instanceGuard = t.intersection(t.instanceIsA("Part"), t.children({
Part = t.instanceIsA("Part"),
})),
} })
Reflect.decorate(WUIC_AudioQueueDisplay, "$c:components@Component", Component, { {
tag = "AudioQueueDisplay",
attributes = {},
instanceGuard = t.intersection(t.instanceIsA("Part"), t.children({
Part = t.instanceIsA("Part"),
})),
} })
Full error:
15:38:00.477 [Flamework] Infinite yield possible on instance 'Workspace.AudioQueueDisplay.Part' - Client - componentTracker:169
15:38:00.477 Waiting for component 'client/components/AudioQueueDisplay/WUIC_AudioQueueDisplay@WUIC_AudioQueueDisplay' - Client - componentTracker:170
15:38:00.478 Waiting for the following criteria: type guard - Client - componentTracker:171
15:38:00.477 [Flamework] Infinite yield possible on instance 'Workspace.AudioQueueDisplay.Part' - Client - componentTracker:169
15:38:00.477 Waiting for component 'client/components/AudioQueueDisplay/WUIC_AudioQueueDisplay@WUIC_AudioQueueDisplay' - Client - componentTracker:170
15:38:00.478 Waiting for the following criteria: type guard - Client - componentTracker:171
No description
No description
Solution:
Yw ^w^
Jump to solution
61 Replies
wAD
wAD4d ago
cannot extend it like thaat has type type Foo = Part & { Part: Part }
kv_
kv_OP4d ago
I changed it to
type Instance = Part & {
Part: Part;
};
type Instance = Part & {
Part: Part;
};
but that compiles the same and the type guard still fails it is a normal part
kv_
kv_OP4d ago
confusing to me because i also have this and it works
No description
wAD
wAD4d ago
no clue
kv_
kv_OP4d ago
🥰 yippee
PepeElToro41
PepeElToro414d ago
maybe dont call it Instance because it would conflict with the Instance interface
kv_
kv_OP4d ago
I did try that did not work :( I have also tried deleting my out folder
PepeElToro41
PepeElToro414d ago
F
Tester
Tester4d ago
Can you show the structure of the instance when it fails to instantiate? Usually it happens when something is not anchored and falls through the map, or impacted by streaming
kv_
kv_OP4d ago
i did notice that when i break on the warning the part is not there, but it is moreso confusing because the part is rendered before the script breaks
No description
kv_
kv_OP4d ago
No description
kv_
kv_OP4d ago
i know its not replication/streaming since the object is obviously there ☹️
No description
kv_
kv_OP4d ago
Transparent object is the descendant
Tester
Tester4d ago
Is it anchored? The part in a part? And is it named Part
kv_
kv_OP4d ago
Both are anchored and the transparent part has cancollide disabled
Tester
Tester4d ago
And how big is the map?
kv_
kv_OP4d ago
not big <1000 studs
kv_
kv_OP4d ago
the descendant is named part
No description
Tester
Tester4d ago
Can you add something into onStart Like a print Cause it might say that it's waiting for guard, but actually created after warning
kv_
kv_OP4d ago
it does not print
Tester
Tester4d ago
Mmm
kv_
kv_OP4d ago
the component is obviously not constructing ever since otherwise it should be displaying a surfacegui
Tester
Tester4d ago
Oh wait, might be the silly reason T_T
kv_
kv_OP4d ago
unless it is and i have messed up the portal creation however i doubt it
Tester
Tester4d ago
You have your interface named as the existing thing Aka Instance already exists
kv_
kv_OP4d ago
No description
kv_
kv_OP4d ago
also already been ruled out
Tester
Tester4d ago
Mmm Other thing Can you override the predicate in @Component and print the instance structure There's a function called predicate Which decides whether the component should be instantiated Or even guard function I think I will give you insights on what's wrong And print the structure of the instance
kv_
kv_OP4d ago
predicate does not run because instance guard fails first
Tester
Tester4d ago
You sure? Isn't it wiseversa?
kv_
kv_OP4d ago
@Component({
tag: 'AudioQueueDisplay',
predicate: (a) => {
a.GetDescendants().forEach((d) => print(d.Name));
return true;
},
})
@Component({
tag: 'AudioQueueDisplay',
predicate: (a) => {
a.GetDescendants().forEach((d) => print(d.Name));
return true;
},
})
i can also try it with the instance guard
Tester
Tester4d ago
^ would be the best And can you do GetFullName instead
kv_
kv_OP4d ago
if i am reading this correct i can not in fact do it with the instance guard
No description
Tester
Tester4d ago
return Flamework.createGuard<ComponentInstance>()(a)
kv_
kv_OP4d ago
a callback with the proper return type is not a valid type and i am also not sure how to pipe the instance into the guard function i created
No description
kv_
kv_OP4d ago
since without a callback i cannot capture it? also the type assertion i need to do to pass a to createGuard seems like it will not work
Tester
Tester4d ago
Put this, but just do this in the function for guard return Flamework.createGuard<ComponentInstance>()(a) as never ^ and careful You have to call it twice
kv_
kv_OP4d ago
instance guard is the t.check type it cannot be a callback
No description
Tester
Tester4d ago
Remove as never for a sec
kv_
kv_OP4d ago
ah ok its bc i wasnt calling it twice before that works
kv_
kv_OP4d ago
No description
Tester
Tester4d ago
Mm?
kv_
kv_OP4d ago
ahahahahahahaahha rojo did not sync any of those things i tried ever
Tester
Tester4d ago
💔 Imagine...
kv_
kv_OP4d ago
ok well there is this now
No description
Tester
Tester4d ago
Does it still warn?
kv_
kv_OP4d ago
let me make it not aids to read yes
kv_
kv_OP4d ago
No description
kv_
kv_OP4d ago
the part seems to exist during the instance guard call?
Tester
Tester4d ago
Wait, it told onStart worked
kv_
kv_OP4d ago
yes it did im not sure what is happening now
Tester
Tester4d ago
Can you remove your guard?
kv_
kv_OP4d ago
it did construct
Tester
Tester4d ago
And can you do override destroy(){ super.destroy(); print("Got destroyed") }
kv_
kv_OP4d ago
its not being destroyed
Tester
Tester4d ago
Ok, then it's great?
kv_
kv_OP4d ago
ehh yes it is sort of fixed however the type guard initially still does not pass i still get the warning although the component does eventually construct
Tester
Tester4d ago
Wut? Prob for the other thing? Can you search up instances with the same tag Prob you accidentally put it somewhere else
kv_
kv_OP4d ago
yes the descendant was also tagged since it was duplicated from the parent i am not sure what fixed this but apparently something i did while rojo was dead fixed it thanks
Tester
Tester4d ago
Prob the thing with changing it to type
Solution
Tester
Tester4d ago
Yw ^w^

Did you find this page helpful?