function findOrCreateMatch(ctx: nkruntime.Context, logger: nkruntime.Logger, nk: nkruntime.Nakama, payload: string): string {
logger.info('findOrCreateMatch rpc called');
const limit = 10;
const isAuthoritative = true;
const minSize = 1;
const maxSize = 2;
const label = "";
var matches = nk.matchList(limit, isAuthoritative, label, minSize, maxSize, "");
// If matches exist, sort by match size and return the largest.
if (matches.length > 0) {
matches.sort(function (a, b) {
return a.size >= b.size ? 1 : -1;
});
return matches[0].matchId;
}
// If no matches exist, create a new one using the "lobby" module and return it's ID.
var matchId = nk.matchCreate('supermatch', { debug: true });
return JSON.stringify({ matchId });
}
however when I send request in API EXPLORER it gives me an error: rpc error: code = Internal desc = GoError: error creating match: error creating match: not found at github.com/heroiclabs/nakama/v3/server.(*runtimeJavascriptNakamaModule).matchCreate.func1 (native)
been reading more about the docs, and found out that it might be the problem, I haven’t registered/defined it on my InitModule . Heres my main.ts that has the InitModule: