Skip to content

Maximum stack call size exceeded when using DomBodies.block during runtime #4

@louisch

Description

@louisch

It seems when adding a block while the simulation is running (Runner.run(runner, engine) has been called etc.), a deep copy triggered from inside the DomBodies.block function goes into an endless loop, resulting in a stack call size exceeded error.
The element I'm adding can be added fine if it is added before the simulation starts running, so I'm fairly certain that the problem is that the render has some kind of circular reference after starting the simulation.

    let matterBlock = DomBodies.block(x, y, {
      Dom: {
        render: this.render,
        element,
      },
      width,
      height
    });
    World.add(this.engine.world, matterBlock);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions