Yes, I found it but I really want to know about the TypeScript natural import that is giving error is not working at all with the nakama server template with the RPCs
Example below of RPC file:
Import ‘nameClass’ from ‘./nameClass.ts’
function TestRpc(ctx: nkruntime.Context, logger: nkruntime.Logger, nk: nkruntime.Nakama, payload: string): string {
logger.info(“TestRPC called!”);
return JSON.stringify({ success: true, nameClass });
}
and whoever I initialize in main returns this error: ( Cannot locate the name ‘TestRpc’. Did you mean ‘testRpc’? )
Example below the main file
// Copyright 2020 The Nakama Authors
//
// Licensed under the Apache License, Version 2.0 (the “License”);
const testRpc = ‘testRpc_js’;
function InitModule(ctx: nkruntime.Context, logger: nkruntime.Logger, nk: nkruntime.Nakama, initializer: nkruntime.Initializer)
{
initializer.registerRpc(testRpc, TestRpc); -> here and the error( Cannot find the name 'TestRpc'. Did you mean 'testRpc'? main.ts(6, 7): 'testRpc' is declared here. )
initializer.registerMatch(matchIdentifyer, {
matchInit,
matchJoinAttempt,
matchJoin,
matchLeave,
matchLoop,
matchTerminate,
matchSignal,
});
logger.info('SERVER INITIALIZED');
}
I just want to know why when I import a file into an RPC it is invalidating the RPC?