I have seen two related posted to this topic, but I cannot find any further information so I am resorting to a forum post.
I am using Node.js and Express.js as the server host. I am using npm to install phaser.
No matter what I do, I get “navigator is not defined” in reference to the following module code
node_modules\phaser\src\device\OS.js:69
var ua = navigator.userAgent;
I am fairly experienced with Express.js in general, and everything seems to be running fine. The issue appears to be with Phaser. I’m not sure what the problem is. I have seen individuals saying that Phaser 3 is not meant to be loaded in the server, yet all of the Getting Started documentation suggests this is a requirement, so I don’t understand. I have looked through multiple third-party guides as well, but to no avail.
Thank you for trying to help me. I’m probably being an idiot here, but are you saying that I need to serve the index.html from a separate webserver and not within the code that the game.js file is running in? Seems weird to me. Maybe there’s something I’m fundamentally misunderstanding about Phaser.