Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

189
Views
Cannot read properties of undefined (reading 'create')

I decided to create a game called Slinky Untangle. I chose to use Matter.JS, Executing the code, I get this

TypeError: Cannot read properties of undefined (reading 'create') at /script.js:12:21

Here is my code.

let Engine
x=document.createElement("script");x.src="https://github.com/liabru/matter-js/raw/master/build/matter.js"; document.head.appendChild(x);
var slinky = slinky || {};

slinky.wiggle = function() {
 Engine = slinky.Engine;
 Render = slinky.Render;
 Body = slinky.Body;
 MouseConstraint =
  slinky.MouseConstraint
};
var engine = Engine.create(),
 world = engine.world;
var render = Render.create({
  element: document.body,
  engine: engine,
  options: {
    width: 800,
    height: 600,
    wireframes: false
  }
});

I am quite new to JavaScript although I known it a lot.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!