HoloLite Posted February 26, 2018 Share Posted February 26, 2018 I just synced to npm package alphaA. It built ok but I am getting the following run-time errors (from console log). babylon.inspector.bundle.js:1 Uncaught TypeError: Cannot read property 'Vector2' of undefined at i (babylon.inspector.bundle.js:1) at Object.eval (babylon.inspector.bundle.js:1) at t (babylon.inspector.bundle.js:1) at Object.eval (babylon.inspector.bundle.js:1) at t (babylon.inspector.bundle.js:1) at eval (babylon.inspector.bundle.js:1) at eval (babylon.inspector.bundle.js:1) at n (babylon.inspector.bundle.js:1) at eval (babylon.inspector.bundle.js:1) at Object.../../../../babylonjs-inspector/babylon.inspector.bundle.js (vendor.bundle.js:29) Quote Link to comment Share on other sites More sharing options...
RaananW Posted February 27, 2018 Share Posted February 27, 2018 Hi @HoloLite, could you try removing the inspector's package from package.json and try loading babylon again? the inspector should load even if it is not included. I have tested the inspector a few times and made sure it is working, so I just want to debug it a bit further and understand the base for this error. Quote Link to comment Share on other sites More sharing options...
HoloLite Posted February 27, 2018 Author Share Posted February 27, 2018 OK I will try your suggestion as soon as I get into the office. Quote Link to comment Share on other sites More sharing options...
HoloLite Posted February 27, 2018 Author Share Posted February 27, 2018 I kept the inspector package from package.json, but I did remove it from the .ts file (the import babylonjs-inspector was removed) and the problem goes away. Thanks! Quote Link to comment Share on other sites More sharing options...
RaananW Posted February 27, 2018 Share Posted February 27, 2018 Just to let you know - I found the core of the problem, and the next npm package will have a working inspector package. but even if you don't include the inspector, it will be loaded async when needed. Quote Link to comment Share on other sites More sharing options...
HoloLite Posted February 27, 2018 Author Share Posted February 27, 2018 I understood that I did not need to explicitly import the inspector - I should've had those import lines removed. After removing the imports, the issue was gone in alphaA as I mentioned previously, and the thing is the inspector is working as far as I can tell. I can see the inspector windows on the right. So my question is what is broken here ? Quote Link to comment Share on other sites More sharing options...
RaananW Posted February 28, 2018 Share Posted February 28, 2018 Nothing is broken, it all works as expected. The problem was the way the inspector was declared and the dependencies it took when initialized. If you want to use a specific version of the inspector, you can force a specific version. if not, BABYLON will download the latest version and add it to the current context. In this case, it won't use module.exports, exports or defines (in case of amd), but will use the regular vanilla JS way, which works as expected. Next NPM package is coming up later on today, and it will have a fix for that issue. HoloLite 1 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.