I am having this error on a sample project whenever i try to update Nakama from 3.17.1 to any updated version.
2024-04-15 08:42:05 panic: interface conversion: ast.Property is *ast.PropertyShort, not *ast.PropertyKeyed [recovered]
2024-04-15 08:42:05 panic: interface conversion: ast.Property is *ast.PropertyShort, not *ast.PropertyKeyed [recovered]
2024-04-15 08:42:05 panic: interface conversion: ast.Property is *ast.PropertyShort, not *ast.PropertyKeyed [recovered]
2024-04-15 08:42:05 panic: interface conversion: ast.Property is *ast.PropertyShort, not *ast.PropertyKeyed
if i remove the match registration in the InitModule it works:
initializer.registerMatch('match', {
matchInit,
matchJoinAttempt,
matchJoin,
matchLeave,
matchLoop,
matchTerminate,
matchSignal
});
const matchInit : nkruntime.MatchInitFunction = function (ctx: nkruntime.Context, logger: nkruntime.Logger, nk: nkruntime.Nakama, params: {[key: string]: string}): {state: nkruntime.MatchState, tickRate: number, label: string} {
logger.debug(‘Lobby match created’);
return {
state: { Debug: true },
tickRate: 10,
label: 'wow'
};
};
const matchJoin : nkruntime.MatchJoinFunction = function (ctx: nkruntime.Context, logger: nkruntime.Logger, nk: nkruntime.Nakama, dispatcher: nkruntime.MatchDispatcher, tick: number, state: nkruntime.MatchState, presences: nkruntime.Presence) : { state: nkruntime.MatchState } | null {
presences.forEach(function (presence) {
state.presences[presence.userId] = presence;
logger.debug(‘%q joined Lobby match’, presence.userId);
});
return {
state
};
}
const matchJoinAttempt : nkruntime.MatchJoinAttemptFunction = function (ctx: nkruntime.Context, logger: nkruntime.Logger, nk: nkruntime.Nakama, dispatcher: nkruntime.MatchDispatcher, tick: number, state: nkruntime.MatchState, presence: nkruntime.Presence, metadata: {[key: string]: any }) : {state: nkruntime.MatchState, accept: boolean, rejectMessage?: string | undefined } | null {
logger.debug(‘%q attempted to join Lobby match’, ctx.userId);
return {
state,
accept: true
};
}
const matchLeave : nkruntime.MatchLeaveFunction = function (ctx: nkruntime.Context, logger: nkruntime.Logger, nk: nkruntime.Nakama, dispatcher: nkruntime.MatchDispatcher, tick: number, state: nkruntime.MatchState, presences: nkruntime.Presence) : { state: nkruntime.MatchState } | null {
presences.forEach(function (presence) {
state.presences[presence.userId] = presence;
logger.debug(‘%q left Lobby match’, presence.userId);
});
return {
state
};
}
const matchLoop : nkruntime.MatchLoopFunction = function (ctx: nkruntime.Context, logger: nkruntime.Logger, nk: nkruntime.Nakama, dispatcher: nkruntime.MatchDispatcher, tick: number, state: nkruntime.MatchState, messages: nkruntime.MatchMessage) : { state: nkruntime.MatchState} | null {
logger.debug(‘Lobby match loop executed’);
return {
state
};
}
const matchSignal : nkruntime.MatchSignalFunction = function (ctx: nkruntime.Context, logger: nkruntime.Logger, nk: nkruntime.Nakama, dispatcher: nkruntime.MatchDispatcher, tick: number, state: nkruntime.MatchState, data: string) : { state: nkruntime.MatchState, data?: string } | null {
logger.debug('Lobby match signal received: ’ + data);
return {
state,
data: "Lobby match signal received: " + data
};
}
const matchTerminate : nkruntime.MatchTerminateFunction = function (ctx: nkruntime.Context, logger: nkruntime.Logger, nk: nkruntime.Nakama, dispatcher: nkruntime.MatchDispatcher, tick: number, state: nkruntime.MatchState, graceSeconds: number) : { state: nkruntime.MatchState} | null {
logger.debug(‘Lobby match terminated’);
return {
state
};
}