Knit Client not starting

So I am reworking a system with the knit framework and I am currently making an input controller that involves services made by the knit server but I keep getting this error:

This is what I have currently implemented:
image

If anyone knows a solution to this it would be much appreciated.

You are calling Knit.GetService() somewhere in your InputController before Knit has started. Can you show your InputController code?

Could you please show us line 20 of your code? The error message diagnoses it as the problem.

I did some research, and showing us line 20 isn’t going to do us much help here. Do you mind just showing the entire script?

image

it seems like you must be misusing knit
In any case here’s a potential (dirty) solution

local LibraryPromise = Knit.OnStart():andThen(function() return Knit.GetService("FunctionsLibrary") end)
...

local FunctionsLibrary = LibraryPromise:expect() --this will yield

or yield the entire thread

Knit.OnStart():await()

local FunctionsLibrary = Knit.GetService("FunctionsLibrary")

You should be getting other Knit services and Controllers either in :KnitInit or :KnitStart.

I found that the problem was that I called the service in the wrong place

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.