After building TS files from this doc and starting the nakama docker : InitModule function seems to not be executed.
nakama logs :
docker-compose logs -f nakama
devserver-nakama-1 | + /nakama/nakama migrate up --database.address root@cockroachdb:26257
devserver-nakama-1 | {"level":"info","ts":"2023-06-27T15:06:59.456Z","caller":"migrate/migrate.go:155","msg":"Database connection","dsn":"postgres://root@cockroachdb:26257/nakama?sslmode=prefer"}
devserver-nakama-1 | {"level":"info","ts":"2023-06-27T15:06:59.469Z","caller":"migrate/migrate.go:203","msg":"Database information","version":"CockroachDB CCL v20.2.19 (x86_64-unknown-linux-gnu, built 2022/02/09 18:48:48, go1.13.14)"}
devserver-nakama-1 | {"level":"info","ts":"2023-06-27T15:06:59.518Z","caller":"migrate/migrate.go:226","msg":"Successfully applied migration","count":0}
devserver-nakama-1 | + exec /nakama/nakama --config /nakama/data/my-config.yml --database.address root@cockroachdb:26257 --session.token_expiry_sec 7200 --metrics.prometheus_port 9100
devserver-nakama-1 | {"level":"info","ts":"2023-06-27T15:06:59.531Z","caller":"server/config.go:89","msg":"Successfully loaded config file","path":"/nakama/data/my-config.yml"}
devserver-nakama-1 | {"level":"info","ts":"2023-06-27T15:06:59.531Z","caller":"main.go:103","msg":"Nakama starting"}
devserver-nakama-1 | {"level":"info","ts":"2023-06-27T15:06:59.531Z","caller":"main.go:104","msg":"Node","name":"nakama-node-1","version":"3.16.0+27ba93d3","runtime":"go1.20.3","cpu":16,"proc":16}
devserver-nakama-1 | {"level":"info","ts":"2023-06-27T15:06:59.531Z","caller":"main.go:105","msg":"Data directory","path":"./data/"}
devserver-nakama-1 | {"level":"info","ts":"2023-06-27T15:06:59.531Z","caller":"main.go:124","msg":"Database connections","dsns":["root@cockroachdb:26257"]}
devserver-nakama-1 | {"level":"debug","ts":"2023-06-27T15:06:59.532Z","caller":"server/db.go:69","msg":"Complete database connection URL","raw_url":"postgres://root@cockroachdb:26257/nakama?sslmode=prefer"}
devserver-nakama-1 | {"level":"info","ts":"2023-06-27T15:06:59.534Z","caller":"main.go:130","msg":"Database information","version":"CockroachDB CCL v20.2.19 (x86_64-unknown-linux-gnu, built 2022/02/09 18:48:48, go1.13.14)"}
devserver-nakama-1 | {"level":"info","ts":"2023-06-27T15:06:59.536Z","caller":"server/metrics.go:176","msg":"Starting Prometheus server for metrics requests","port":9100}
devserver-nakama-1 | {"level":"info","ts":"2023-06-27T15:06:59.561Z","caller":"server/leaderboard_rank_cache.go:117","msg":"Initializing leaderboard rank cache"}
devserver-nakama-1 | {"level":"info","ts":"2023-06-27T15:06:59.561Z","caller":"server/leaderboard_rank_cache.go:249","msg":"Leaderboard rank cache initialization completed successfully","cached":[],"skipped":[]}
devserver-nakama-1 | {"level":"info","ts":"2023-06-27T15:06:59.562Z","caller":"server/runtime.go:621","msg":"Initialising runtime","path":"data/modules"}
devserver-nakama-1 | {"level":"info","ts":"2023-06-27T15:06:59.562Z","caller":"server/runtime.go:628","msg":"Initialising runtime event queue processor"}
devserver-nakama-1 | {"level":"info","ts":"2023-06-27T15:06:59.562Z","caller":"server/runtime.go:630","msg":"Runtime event queue processor started","size":65536,"workers":8}
devserver-nakama-1 | {"level":"info","ts":"2023-06-27T15:06:59.562Z","caller":"server/runtime_go.go:2643","msg":"Initialising Go runtime provider","path":"data/modules"}
devserver-nakama-1 | {"level":"info","ts":"2023-06-27T15:06:59.562Z","caller":"server/runtime_go.go:2667","msg":"Go runtime modules loaded"}
devserver-nakama-1 | {"level":"info","ts":"2023-06-27T15:06:59.562Z","caller":"server/runtime_lua.go:113","msg":"Initialising Lua runtime provider","path":"data/modules"}
devserver-nakama-1 | {"level":"info","ts":"2023-06-27T15:06:59.562Z","caller":"server/runtime_lua.go:1200","msg":"Lua runtime modules loaded"}
devserver-nakama-1 | {"level":"info","ts":"2023-06-27T15:06:59.562Z","caller":"server/runtime_lua.go:1203","msg":"Allocating minimum Lua runtime pool","count":16}
devserver-nakama-1 | {"level":"info","ts":"2023-06-27T15:06:59.562Z","caller":"server/runtime_lua.go:1211","msg":"Allocated minimum Lua runtime pool"}
devserver-nakama-1 | {"level":"info","ts":"2023-06-27T15:06:59.562Z","caller":"server/runtime_javascript.go:612","msg":"Initialising JavaScript runtime provider","path":"data/modules","entrypoint":""}
devserver-nakama-1 | {"level":"info","ts":"2023-06-27T15:06:59.563Z","caller":"server/runtime_javascript.go:1688","msg":"JavaScript runtime modules loaded"}
devserver-nakama-1 | {"level":"info","ts":"2023-06-27T15:06:59.563Z","caller":"server/runtime_javascript.go:1691","msg":"Allocating minimum JavaScript runtime pool","count":16}
devserver-nakama-1 | {"level":"info","ts":"2023-06-27T15:06:59.579Z","caller":"server/runtime_javascript.go:1699","msg":"Allocated minimum JavaScript runtime pool"}
devserver-nakama-1 | {"level":"info","ts":"2023-06-27T15:06:59.579Z","caller":"server/runtime.go:663","msg":"Found runtime modules","count":1,"modules":["index.js"]}
devserver-nakama-1 | {"level":"info","ts":"2023-06-27T15:06:59.579Z","caller":"server/api.go:136","msg":"Starting API server for gRPC requests","port":7349}
devserver-nakama-1 | {"level":"info","ts":"2023-06-27T15:06:59.580Z","caller":"server/api.go:287","msg":"Starting API server gateway for HTTP requests","port":7350}
devserver-nakama-1 | {"level":"info","ts":"2023-06-27T15:06:59.582Z","caller":"server/console.go:218","msg":"Starting Console server for gRPC requests","port":7348}
devserver-nakama-1 | {"level":"info","ts":"2023-06-27T15:06:59.582Z","caller":"server/console.go:321","msg":"Starting Console server gateway for HTTP requests","port":7351}
devserver-nakama-1 | {"level":"info","ts":"2023-06-27T15:06:59.650Z","caller":"main.go:189","msg":"Startup done"}
docker-compose exec nakama cat /nakama/data/modules/index.js :
"use strict";
var InitModule = function (ctx, logger, nk, initializer) {
logger.info("Hello World!");
};
What could prevent this ?