LuaU type checking warnings problem

So I’ve recently been working a decent amount with LuaU, but I’ve encountered some problems with my UI local scripts.

I’ve defined various parts of my UI as local variables, and then inserted their type. However I get a warning for doing this. W000: Type 'Instance' could not be converted to Frame (or whatever the type I put in)

I’m not entirely sure what is causing this, however if I set their type to Instance I get warnings later down the line that say Instance does not have the property Size (or whatever property I am changing)

Does anyone know exactly the reason for this? Is it a bug potentially or am I doing something wrong!

Thanks in advance, kingerman88

Script
local player = Players.LocalPlayer;

local root:Frame = script.Parent:WaitForChild("Main"); --luau what?

local holder:Frame = root:WaitForChild("Holder");

local inProgress:Frame = holder:WaitForChild("InProgress");

local resourceSelection:Frame = holder:WaitForChild("Resources");

local slots:Frame = holder:WaitForChild("Slots");

Comment: If I use a service and do

local remote:RemoteEvent = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent");

it works perfectly fine with no warning


1 Like

Just exit out of studio and open it again.

2 Likes

I’ve done that before, doesn’t seem to want to change the warnings. But thanks for the suggestion :slight_smile:

1 Like

Still having this issue, not sure if anyone has a solution or any other potential ways to solve this :stuck_out_tongue:

same thing happened to me aswell, deleted my studio and tried other stuff but none of it worked, no idea what is the problem