Hi,
I try to run matter-js serverside in node. Actually I have browser simulation which I'm porting to the server now. I got rid of renderer and now the obstacle is when I run most basic code:
var Mt = require('matter-js')
this.engine = Mt.Engine.create() // throws error: 'HTMLElement is not defined'
Which points me right to the very beginning of the Engine.create() function:
Engine.create = function(element, options) {
// options may be passed as the first (and only) argument
options = Common.isElement(element) ? options : element; /// <----
element = Common.isElement(element) ? element : null;
options = options || {};
(...)
and:
Common.isElement = function(obj) {
return obj instanceof HTMLElement;
};
This is SO obvious that I suspect I may be doing something totally wrong. I can't see any mention of Node specific setup in the getting started...
Hi,
I try to run matter-js serverside in node. Actually I have browser simulation which I'm porting to the server now. I got rid of renderer and now the obstacle is when I run most basic code:
Which points me right to the very beginning of the Engine.create() function:
and:
This is SO obvious that I suspect I may be doing something totally wrong. I can't see any mention of Node specific setup in the getting started...