"ViewportDisplaySize is not a valid member of GuiService" warning when using FindFirstChild, WaitForChild,etc in certain locations in studio

Using FindFirstChild, FindFirstChildOfClass, WaitForChild, etc in studio with the Tool class for example (some other classes do the same its not exclusive to Tool) in certain locations will cause the “ViewportDisplaySize is not a valid member of GuiService” warning to appear if it returns something, if it returns nil then the warning wont appear

Script ran:

local services = {
	game:GetService("Workspace"),
	game:GetService("Players"),
	game:GetService("Lighting"),
	game:GetService("Workspace"),
	game:GetService("MaterialService"),
	game:GetService("ReplicatedFirst"),
	game:GetService("ReplicatedStorage"),
	game:GetService("ServerScriptService"),
	game:GetService("ServerStorage"),
	game:GetService("StarterGui"),
	game:GetService("StarterPack"),
	game:GetService("StarterPlayer"),
	game:GetService("StarterPlayer").StarterCharacterScripts,
	game:GetService("StarterPlayer").StarterPlayerScripts,
	game:GetService("Teams"),
	game:GetService("SoundService"),
	game:GetService("TextChatService")
}

for _, service in services do
	print(service.Name, service:FindFirstChildOfClass("Tool"))
end

Output:

I have checked its not my plugins

Expected behavior

I expect the warning not to appear

Hi, thanks for reporting this! We haven’t been able to reproduce the issue. Could you check if there’s any code calling the ViewportDisplaySize API, especially in the Tool’s scripts? Also, if possible, please share the place file where you encountered the problem — that would help us debug it more effectively. Thanks!

Hi, sorry I realise I didn’t provide enough information for you to reproduce this bug properly.

The warning only appears (the item must exist) if you print or warn service:FindFirstChildOfClass("Tool") for example.
This is not exclusive to just tools it happens to other things like a Script in MaterialService
image

Here is the RBXL file (the script is in ServerScriptService)
ViewportDisplaySize_Bug.rbxl (58.5 KB)

or if you want to try reproduce the bug independently do the following:

  • Create a new place
  • Insert a tool in MaterialService
  • Run this script in your command bar or in a server script and press run server or play: print(game.MaterialService:FindFirstChild("Tool"))

All you gotta do to get this warning is just indexing GuiService.ViewportDisplaySize.

Version is
image

All you gotta do to get this warning is just indexing GuiService.ViewportDisplaySize.

Yeah this is expected since the API is not fully released yet, please check out [Studio Beta] Build Cross-Platform UI with the ViewportDisplaySize API on enabling studio beta feature to use this API in studio. Thanks!

Appreciate the example place! We can now repro the issue and are working on a fix. We’ll keep you posted on any updates

Thanks for waiting and reporting the issue! This should be fixed now. Please let us know if you still see any issue, thanks!