# Phaser on the server

**URL:** <https://phaser.discourse.group/t/phaser-on-the-server/6230>\
**Category:** Phaser 3\
**Created:** [May 6, 2020, 7:49pm UTC](https://phaser.discourse.group/t/phaser-on-the-server/6230 "2020-05-06T19:49:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhudsonsg](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@jhudsonsg](https://phaser.discourse.group/u/jhudsonsg)\
**Post date:** [May 6, 2020, 7:49pm UTC](https://phaser.discourse.group/t/phaser-on-the-server/6230/1 "2020-05-06T19:49:50Z")

</div>

Hello everyone,

I am wondering how do I run the node on the server side to be able to calculate the physics of various movements that I will make in the game menu, any recent tutorial?

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [May 6, 2020, 8:32pm UTC](https://phaser.discourse.group/t/phaser-on-the-server/6230/2 "2020-05-06T20:32:50Z")

</div>

> [@Phaser 3 - Real-Time Multiplayer Game with Physics](https://phaser.discourse.group/t/phaser-3-real-time-multiplayer-game-with-physics/1739):
>
> Phaser 3 - Real-Time Multiplayer Game with Physics What is so special about this example? All the physics (MatterJS and Arcade) is entirely calculated on a NodeJS server. The client only received the positions {x, y} and other necessary properties like rotation, animation and tint of each object. It uses a unmodified Phaser 3.16.2 version from npm. Example You can [play the example here](http://phaser3-multiplayer-example.herokuapp.com/). It runs on NodeJS on Heroku (Free Dyno in Europe) which causes the example sometimes to take about 1 minute…

---

<div class="post-metadata">

**Author:** ![jhudsonsg](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@jhudsonsg](https://phaser.discourse.group/u/jhudsonsg)\
**Post date:** [May 7, 2020, 8:02pm UTC](https://phaser.discourse.group/t/phaser-on-the-server/6230/3 "2020-05-07T20:02:56Z")

</div>

Hello Samme,

I made a copy of the project and projected it from there, but I get a lot of errors when executed, I use version 12 of nodejs and my repository is this [https://github.com/jhudsonsg/war-history-server](https://github.com/jhudsonsg/war-history-server)

the errors that appear:

FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal.  
1: 00007FF72AC5D1EF napi\_wrap+113103  
2: 00007FF72ABFCA66 v8::base::CPU::has\_sse+64982  
3: 00007FF72ABFD8F3 v8::base::CPU::has\_sse+68707  
4: 00007FF72B422F05 v8::V8::ToLocalEmpty+53  
5: 00007FFFE12E506D Canvas::stride+255157  
6: 00007FFFE12B64F7 Canvas::stride+63807  
7: 00007FF72B3CD850 v8::internal::Builtins::builtin\_handle+323456  
8: 00007FF72B3CCD97 v8::internal::Builtins::builtin\_handle+320711  
9: 00007FF72B3CD0D8 v8::internal::Builtins::builtin\_handle+321544  
10: 00007FF72B3CCEDE v8::internal::Builtins::builtin\_handle+321038  
11: 00007FF72B866D4D v8::internal::SetupIsolateDelegate::SetupHeap+546893  
12: 00007FF72B7EBBFC v8::internal::SetupIsolateDelegate::SetupHeap+42748  
13: 00007FF72B7EBBFC v8::internal::SetupIsolateDelegate::SetupHeap+42748  
14: 00007FF72B7E9131 v8::internal::SetupIsolateDelegate::SetupHeap+31793  
15: 00007FF72B7E8D1C v8::internal::SetupIsolateDelegate::SetupHeap+30748  
16: 00007FF72B3278A3 v8::internal::Execution::CallWasm+1395  
17: 00007FF72B327226 v8::internal::Execution::Call+182  
18: 00007FF72B1464EF v8::internal::Object::SetProperty+2495  
19: 00007FF72B146040 v8::internal::Object::SetProperty+1296  
20: 00007FF72B145A68 v8::internal::Object::SetProperty+72  
21: 00007FF72B2709E9 v8::internal::StubCache::Set+61625  
22: 00007FF72B26A1EF v8::internal::StubCache::Set+35007  
23: 00007FF72B866C4D v8::internal::SetupIsolateDelegate::SetupHeap+546637  
24: 00007FF72B8C2FAE v8::internal::SetupIsolateDelegate::SetupHeap+924334  
25: 00007FF72B7EBBFC v8::internal::SetupIsolateDelegate::SetupHeap+42748  
26: 00007FF72B7EBBFC v8::internal::SetupIsolateDelegate::SetupHeap+42748  
27: 00007FF72B7EBBFC v8::internal::SetupIsolateDelegate::SetupHeap+42748  
28: 00007FF72B7E4F2C v8::internal::SetupIsolateDelegate::SetupHeap+14892  
29: 00007FF72B7EBBFC v8::internal::SetupIsolateDelegate::SetupHeap+42748  
30: 00007FF72B7EBBFC v8::internal::SetupIsolateDelegate::SetupHeap+42748  
31: 00007FF72B7E4F2C v8::internal::SetupIsolateDelegate::SetupHeap+14892  
32: 00007FF72B7EBBFC v8::internal::SetupIsolateDelegate::SetupHeap+42748  
33: 00007FF72B7EBBFC v8::internal::SetupIsolateDelegate::SetupHeap+42748  
34: 00007FF72B7EBBFC v8::internal::SetupIsolateDelegate::SetupHeap+42748  
35: 00007FF72B7EBBFC v8::internal::SetupIsolateDelegate::SetupHeap+42748  
36: 00007FF72B7EBBFC v8::internal::SetupIsolateDelegate::SetupHeap+42748  
37: 00007FF72B7EBBFC v8::internal::SetupIsolateDelegate::SetupHeap+42748  
38: 00007FF72B7E4F2C v8::internal::SetupIsolateDelegate::SetupHeap+14892  
39: 00007FF72B839DC6 v8::internal::SetupIsolateDelegate::SetupHeap+362694  
40: 00007FF72B7E72B3 v8::internal::SetupIsolateDelegate::SetupHeap+23987  
41: 00007FF72B8CB430 v8::internal::SetupIsolateDelegate::SetupHeap+958256  
42: 00007FF72B7EBBFC v8::internal::SetupIsolateDelegate::SetupHeap+42748  
43: 00007FF72B7E4F2C v8::internal::SetupIsolateDelegate::SetupHeap+14892  
44: 00007FF72B7EBBFC v8::internal::SetupIsolateDelegate::SetupHeap+42748  
45: 00007FF72B7EBBFC v8::internal::SetupIsolateDelegate::SetupHeap+42748  
46: 00007FF72B83B202 v8::internal::SetupIsolateDelegate::SetupHeap+367874  
47: 00007FF72B808D9D v8::internal::SetupIsolateDelegate::SetupHeap+161949  
48: 00007FF72B7E901C v8::internal::SetupIsolateDelegate::SetupHeap+31516  
49: 00007FF72B327930 v8::internal::Execution::CallWasm+1536  
50: 00007FF72B327A23 v8::internal::Execution::CallWasm+1779  
51: 00007FF72B327E02 v8::internal::Execution::TryCall+354  
52: 00007FF72B309E15 v8::internal::MicrotaskQueue::RunMicrotasks+501  
53: 00007FF72B3CD850 v8::internal::Builtins::builtin\_handle+323456  
54: 00007FF72B3CCD97 v8::internal::Builtins::builtin\_handle+320711  
55: 00007FF72B3CD0D8 v8::internal::Builtins::builtin\_handle+321544  
56: 00007FF72B3CCEDE v8::internal::Builtins::builtin\_handle+321038  
57: 00007FF72B866D4D v8::internal::SetupIsolateDelegate::SetupHeap+546893  
58: 00007FF72B7EBBFC v8::internal::SetupIsolateDelegate::SetupHeap+42748  
59: 00007FF72B7E9131 v8::internal::SetupIsolateDelegate::SetupHeap+31793  
60: 00007FF72B7E8D1C v8::internal::SetupIsolateDelegate::SetupHeap+30748  
61: 00007FF72B3278A3 v8::internal::Execution::CallWasm+1395  
62: 00007FF72B327226 v8::internal::Execution::Call+182  
63: 00007FF72B3F829D v8::Function::Call+605  
64: 00007FF72AC7D008 node::CallbackScope::~CallbackScope+776  
65: 00007FF72AC7CD6E node::CallbackScope::~CallbackScope+110  
66: 00007FF72ABB47A5 v8::internal::interpreter::BytecodeArrayWriter::source\_position\_table\_builder+31605  
67: 00007FF72AC26433 node::Start+275  
68: 00007FF72AA96A9C RC4\_options+340380  
69: 00007FF72B91ED38 v8::internal::SetupIsolateDelegate::SetupHeap+1300536  
70: 00007FF81AB77BD4 BaseThreadInitThunk+20  
71: 00007FF81C74CE51 RtlUserThreadStart+33

---

<div class="post-metadata">

**Author:** ![yannick](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/yannick/32/732_2.png) [@yannick](https://phaser.discourse.group/u/yannick)\
**Post date:** [May 9, 2020, 12:25pm UTC](https://phaser.discourse.group/t/phaser-on-the-server/6230/4 "2020-05-09T12:25:00Z")

</div>

If you have trouble setting it up, here is another (simpler) example:

> **[geckosio/phaser3-multiplayer-game-example](https://github.com/geckosio/phaser3-multiplayer-game-example)**
>
> Phaser 3 multiplayer game example using geckos.io. Contribute to geckosio/phaser3-multiplayer-game-example development by creating an account on GitHub.
