fczuardi Posted January 16, 2017 Share Posted January 16, 2017 I don't know if this is the proper place to report bugs, but I couldnt find the Issues link of this project github page. I am trying to use babylon as a browserify module with the budo webserver: https://github.com/mattdesl/budo Here is my index.js: var BABYLON = require('babylonjs/babylon.max'); var html = require('bel'); var canvas = html`<canvas id="renderCanvas"></canvas>`; document.body.appendChild(canvas); window.addEventListener('DOMContentLoaded', function() { console.log('DOMContentLoaded'); console.log(canvas); var engine = new BABYLON.Scene(canvas, true); }); Then, when I open localhost:9966 I get the error of the title: "Uncaught TypeError: Cannot read property 'push' of undefined" The line that throws this error is the line 16958 of babylon.max.js which might be coming from https://github.com/BabylonJS/Babylon.js/blob/49bde9f67194ecc773c07a4ee0064fe836914b59/src/babylon.scene.ts#L575 Any ideas of what I could be doing wrong? Thanks! Quote Link to comment Share on other sites More sharing options...
Sebavan Posted January 17, 2017 Share Posted January 17, 2017 Hello, I guess you forgot the creation of the engine and are creating the scene directly which tries to add itself to the engine on the line you shared but as the engine is replaced by a canvas in your case, the property scenes does not exist and ends up in the exception you see. try the following instead: var engine = new BABYLON.Engine(canvas, true); var scene = new BABYLON.Scene(engine); Quote Link to comment Share on other sites More sharing options...
fczuardi Posted January 18, 2017 Author Share Posted January 18, 2017 Thanks! I got it wowrking, messed up the Engine bit indeed. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.