Key not found in class 'Script' (Scripts Are Non-Strict By Default)

With the Scripts Are Non-Strict By Default beta:

local test = script.Folder

If script.Folder is only added after this is written, the linter will warn: “Key ‘Folder’ not found in class ‘Script’”

Inserting an Instance named Folder will not fix this, even after closing and reopening the script. Studio must be reopened.

6 Likes

Thanks for the report! We’ve filed a ticket to our internal database and we’ll follow up when we have an update for you.

4 Likes

Hello! Could you post the full script to help us better understand what you’re seeing? Thank you

1 Like

I’m also having problems with this beta, where I get the error that Luau will not type check until studio is not restarted, and even so restarting studio doesn’t fix the problem. When I turn off the beta all my scripts fucntion as normal and the type check works.
Different issue, but caused by the same beta.

3 Likes

This is the full script. I’m encountering this on Windows 10. The code is just an example, accessing any child like this which does not exist yet when the code is written will trigger this.

@iSyriux mentioned having this problem in a Luau announcement thread.

4 Likes

I am also encountering this as well with a ColorCorrection effect parented to a folder parented to a ScreenGui in StarterGui

2 Likes

This should be fixed. Thanks for the report!

1 Like