# matchCreate Error when creating match using matchmake

**URL:** <https://forum.heroiclabs.com/t/matchcreate-error-when-creating-match-using-matchmake/5363>\
**Category:** Runtime Framework\
**Tags:** typescript, matches\
**Created:** [June 17, 2024, 5:13pm UTC](https://forum.heroiclabs.com/t/matchcreate-error-when-creating-match-using-matchmake/5363 "2024-06-17T17:13:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sakhile\_Mamba](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@Sakhile\_Mamba](https://forum.heroiclabs.com/u/Sakhile_Mamba)\
**Post date:** [June 17, 2024, 5:13pm UTC](https://forum.heroiclabs.com/t/matchcreate-error-when-creating-match-using-matchmake/5363/1 "2024-06-17T17:13:51Z")

</div>

Hello. I am getting the following error:

{“level”:“error”,“ts”:“2024-06-17T17:06:42.425Z”,“caller”:“server/runtime\_javascript\_logger.go:94”,“msg”:“GoError: error creating match: error creating match: cannot encode params”,“mode”:“matchmaker”}

My match is coming out as a relayed match instead of an authoritative match. What could I be doing wrong?

---

<div class="post-metadata">

**Author:** ![sesposito](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/sesposito/32/2594_2.png) [@sesposito](https://forum.heroiclabs.com/u/sesposito)\
**Post date:** [June 17, 2024, 5:34pm UTC](https://forum.heroiclabs.com/t/matchcreate-error-when-creating-match-using-matchmake/5363/2 "2024-06-17T17:34:05Z")

</div>

The `nk.matchCreate` function is failing to create the match, the `params` argument should be `void` or an object ([nakama-common/index.d.ts at master · heroiclabs/nakama-common · GitHub](https://github.com/heroiclabs/nakama-common/blob/master/index.d.ts#L4020)).

If the param is correct and the function still throws an error please share a code snippet with how you’re calling `nk.MatchCreate()`.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![Sakhile\_Mamba](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@Sakhile\_Mamba](https://forum.heroiclabs.com/u/Sakhile_Mamba)\
**Post date:** [June 17, 2024, 6:30pm UTC](https://forum.heroiclabs.com/t/matchcreate-error-when-creating-match-using-matchmake/5363/3 "2024-06-17T18:30:06Z")

</div>

I removed the parameters completely for now. If I figure out I need to use them in the future and I still get an error, I’ll come back to this post. What do you think would be a good example of using params for a turn-based authoritative crazy eights game?

I’m still learning.

---

<div class="post-metadata">

**Author:** ![sesposito](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/sesposito/32/2594_2.png) [@sesposito](https://forum.heroiclabs.com/u/sesposito)\
**Post date:** [June 17, 2024, 6:43pm UTC](https://forum.heroiclabs.com/t/matchcreate-error-when-creating-match-using-matchmake/5363/4 "2024-06-17T18:43:56Z")

</div>

I suggest you have a look at our authoritative tic-tac-toe implementation example: [GitHub - heroiclabs/nakama-project-template: An example project on how to set up and write custom server code in Nakama server.](https://github.com/heroiclabs/nakama-project-template).

In the template `matchCreate` params are used to start “normal” or “fast” mode matches, the latter having shorter turns so the players have to play faster.

Hope it helps!
