Sleitnick / Knit

Lightweight game framework for Roblox
https://sleitnick.github.io/Knit/
MIT License
566 stars 93 forks source link

Infinite yield possible on 'ReplicatedStorage.Packages.Knit:WaitForChild("Services")' #231

Closed SharkTheScripter closed 9 months ago

SharkTheScripter commented 1 year ago

image

Client:

local Knit = require(game:GetService("ReplicatedStorage"):WaitForChild("Packages"):WaitForChild("Knit"))
Knit.Start():catch(warn):await()
local ReplicationService = Knit.GetService("ReplicationService") -- line 7

Server:

local Knit = require(game:GetService("ReplicatedStorage"):WaitForChild("Packages"):WaitForChild("Knit"))
local ReplicationService = Knit.CreateService(
{
    Name = "ReplicationService",
        Client = {
        Data = Knit.CreateProperty(nil)
    }
})
Sleitnick commented 9 months ago

You need to call Knit.Start() on the server too. If you still get this warning, I would suspect that a service is taking a long time to initialize. The GetService call on the client will yield indefinitely (hence the warning) until the services are available.