heroiclabs / nakama

Distributed server for social and realtime games and apps.

Home Page:https://heroiclabs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Typescript runtime documentation outdated & broken

cidwel opened this issue · comments

Nakama documentation for typescript runtime is outdated and you cannot just follow the manual to get it work

Description

I've tried to follow the instructions here: https://heroiclabs.com/docs/nakama/server-framework/typescript-runtime/
No way to get it working (using just docker, no rollup).

I get errors when trying to run nakama server. It doesn't mention that you need to build the Dockerfile

It's confusing, very confusing. Docker way should be the easiest way to implement nakama. You can get it working easily until you start adding modules in Typescript, which you need to figure out routes by your own to make it work. Same happens with the video which displays a configuration that you cannot mix where youtube user comments suggests changes to the manual to just make the runtime to work

Another example here:
https://heroiclabs.com/docs/nakama/server-framework/typescript-runtime/code-samples/

If you copy-paste the content from match handler you will get a compiler error
image

If you try to fix it, then you get this:
image

If you fix the issue, then no one o the methods do fire when a match is created. Tested it with Fishgame and with my own implementation.

Steps to Reproduce

Follow manual instructions just before "Bundling with Rollup"

Expected Result

Nakama should be running

Actual Result

`

nakama-nakama-1       | {"level":"fatal","ts":"2023-10-19T19:47:01.813Z","caller":"server/config.go:306","msg":"JavaScript entrypoint must be a valid path","error":"stat /nakama/data/modules/build/index.js: no such file or directory"}

Context

  • Unity
  • Unreal
  • [] Other

Your Environment

Last version from tutorial

Hello @cidwel, we'll make sure to improve the documentation. In the meantime you can use our project template for reference.

Hi @sesposito thanks for the help. It seems that template doesn't work out of the box following the tutorial
image

There's some error related with postgres connection

I just attempted to run docker compose up --build on master of the template and do not have this issue. Please run docker compose down and make sure you're not running other containers and try again. If that doesn't work please ask for guidance on our community forum.

Curious, it does work with docker compose up --build as you shown. But not with docker-compose up --build nakama as it displays in the project template installation notes.

not sure if it is some limitation of my docker environment (got it fresh yesterday on Linux Mint)

Thanks

docker compose up --build nakama only runs the Nakama container, whilst docker compose up --build starts all the services defined in the docker-compose.yml file, including the DB which must be running for Nakama to connect. We're tracking this issue and we'll go over the TS guide to improve and fix it.