Hi, I'm not sure how to import colyseus.js in the frontend of my project. In the docs, it says to use import * as Colyseus from "colyseus.js";
, but it gives me an unexpected token * error. In addition, I'm not sure where the colyseus.js library would be coming from. Could someone explain how you are supposed to import this? Thanks!
Problem with importing colyseus.js in the frontend.
Hi @mdmarshmallow,
If you're not using webpack
to build your front-end, you can simply grab the colyseus.js
file from here into your project: https://github.com/colyseus/colyseus.js/tree/master/dist
There's no need to import
this way, since it will be available globally, example:
var client = new Colyseus.Client("ws://localhost:2567");
Cheers