question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

failed with documentation code...

See original GitHub issue

1st time testing here and tried testing out the demo code in getting start, but it kept showing matter-js: Render.create: options.element was undefined, render.canvas was created but not appended warn

`<!DOCTYPE html>

<html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Document</title> <script src="./matter-js-0.16.1/build/matter.js"></script> <script> var Engine = Matter.Engine, Render = Matter.Render, World = Matter.World, Bodies = Matter.Bodies;
  // create an engine
  var engine = Engine.create();

  // create a renderer
  var render = Render.create({
    element: document.body,
    engine: engine,
  });

  // create two boxes and a ground
  var boxA = Bodies.rectangle(400, 200, 80, 80);
  var boxB = Bodies.rectangle(450, 50, 80, 80);
  var ground = Bodies.rectangle(400, 610, 810, 60, { isStatic: true });

  // add all of the bodies to the world
  World.add(engine.world, [boxA, boxB, ground]);

  // run the engine
  Engine.run(engine);

  // run the renderer
  Render.run(render);
</script>
</head> <body></body> </html> `

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
bohemian916commented, Jul 16, 2022

I also faced the same error. It was because I loaded the script in the head section. Instead, I load in the body section, and no error appeared.

1reaction
jyeanncommented, Mar 2, 2021

Thank you, i got it.

some how replaced the source files, the browser show the output.

Regards

'Jyeann Hp +6012 370 7373 Connecting https://www.linkedin.com/in/jye-ann-a4b4333a Creativity https://www.linkedin.com/in/jye-ann-a4b4333a

Design • Trading • Technology

On Mon, Mar 1, 2021 at 8:32 PM michael-garofalo notifications@github.com wrote:

tried you #256 https://github.com/liabru/matter-js/issues/256 (comment) code. still blank browser

Usually, when something like this happens, I open up the developer tools in the browser. Which browser are you using? Typically, there’s a console log message that says what’s wrong.

The HTML, in issue #256 https://github.com/liabru/matter-js/issues/256, is not enough. It needs the matter.min.js file too.

<script src="matter.min.js"></script>

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/liabru/matter-js/issues/972#issuecomment-787914134, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA254O2CGM7F6MC7TPTQVHLTBOCOVANCNFSM4XJYTVPA .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error codes | Stripe Documentation
See the documentation on payment errors for an example. Below is a list of possible error codes, along with additional information about how...
Read more >
API Documentation - Error handling
We use standard HTTP codes to denote successful execution or indicate when errors occur. For some errors, the response will include additional information...
Read more >
Error codes in Device Manager in Windows
Lists the error codes that may be reported by Device Manager and the possible resolutions in Windows.
Read more >
ASAuthorizationError.Code.failed
ASAuthorizationError.Code.failed. The authorization attempt failed. iOS 13.0+ iPadOS 13.0+ macOS 10.15+ Mac Catalyst 13.1+ tvOS 13.0+ watchOS 6.0+ ...
Read more >
Error Codes | Cloud Pub/Sub Documentation
Error HTTP Code Description UNAUTHENTICATED 401 The client is not authenticated properly. UNAVAILABLE 503 The service was unable to process a request.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found