haestflod Posted July 26, 2017 Share Posted July 26, 2017 Hi, I'm in the process of updating from 2.4 -> 3.0.7 and our button to show/hide debuglayer doesn't work anymore because the debug layer throws an exception when show() is called. I saw the InspectorURL points to a preview url: //preview.babylonjs.com/inspector/babylon.inspector.bundle.js The network tab shows that the script loads Here is the information in the console regarding the exception Uncaught ReferenceError: __extends is not defined at babylon.inspector.bundle.js:408 at INSPECTOR (babylon.inspector.bundle.js:408) at Object.global (babylon.inspector.bundle.js:408) at __webpack_require__ (babylon.inspector.bundle.js:21) at Object.<anonymous> (babylon.inspector.bundle.js:49) at __webpack_require__ (babylon.inspector.bundle.js:21) at babylon.inspector.bundle.js:41 at babylon.inspector.bundle.js:44 (anonymous) @ babylon.inspector.bundle.js:408 INSPECTOR @ babylon.inspector.bundle.js:408 global @ babylon.inspector.bundle.js:408 __webpack_require__ @ babylon.inspector.bundle.js:21 (anonymous) @ babylon.inspector.bundle.js:49 __webpack_require__ @ babylon.inspector.bundle.js:21 (anonymous) @ babylon.inspector.bundle.js:41 (anonymous) @ babylon.inspector.bundle.js:44 VM14956:61487 Uncaught TypeError: Cannot read property 'Inspector' of undefined at DebugLayer._createInspector (<anonymous>:61487:48) at HTMLScriptElement.script.onload (<anonymous>:5607:21) Quote Link to comment Share on other sites More sharing options...
Temechon Posted July 27, 2017 Share Posted July 27, 2017 Hello, It's the same bug as this post : We are working on a solution to bundle the inspector with the *__extends* method, it should be available soon. I'll let you know when it's done Quote Link to comment Share on other sites More sharing options...
Temechon Posted July 27, 2017 Share Posted July 27, 2017 I'm waiting for a confirmation, but if it's working you should have a new inspector version that works correctly in few hours. Stay tuned! haestflod 1 Quote Link to comment Share on other sites More sharing options...
Temechon Posted July 28, 2017 Share Posted July 28, 2017 Hi @haestflod, Could you use this version of the inspector : https://raw.githubusercontent.com/Temechon/Babylon.js/master/dist/preview release/inspector/babylon.inspector.bundle.js And let me know if that fix it for you. Thanks ! Quote Link to comment Share on other sites More sharing options...
haestflod Posted July 28, 2017 Author Share Posted July 28, 2017 Hi @Temechon because our server on localhost didn't work against raw.githubusercontent.com (text/plain as mimetype) I changed the url to this inside babylon-max.js: DebugLayer.InspectorURL = 'https://rawgit.com/Temechon/Babylon.js/master/dist/preview release/inspector/babylon.inspector.bundle.js'; After calling .show() now I get the following error: babylon.inspector.bundle.js:409 Uncaught TypeError: BABYLON.Tools.GetClassName is not a function at Function.t.GET_TYPE (babylon.inspector.bundle.js:409) at Object.format (babylon.inspector.bundle.js:408) at n._displayValueContent (babylon.inspector.bundle.js:409) at new n (babylon.inspector.bundle.js:408) at new n (babylon.inspector.bundle.js:409) at new n (babylon.inspector.bundle.js:410) at t._buildInspector (babylon.inspector.bundle.js:408) at new t (babylon.inspector.bundle.js:408) at DebugLayer._createInspector (<anonymous>:61487:35) at HTMLScriptElement.script.onload (<anonymous>:5607:21) I added the function GetClassName to make sure it doesn't crash anywhere else. Tools.GetClassName = Tools.getClassName; It works and I have the debuglayer after that!! Temechon 1 Quote Link to comment Share on other sites More sharing options...
Myjestic Posted August 1, 2017 Share Posted August 1, 2017 Hi, any news to this problem? I got an actual custom Babylon file from the web page. Now it throws excactly the same error. babylon.inspector.bundle.js:409 Uncaught TypeError: BABYLON.Tools.GetClassName is not a function Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 1, 2017 Share Posted August 1, 2017 Ping @Temechon Did you try with the very latest version? Quote Link to comment Share on other sites More sharing options...
haestflod Posted August 3, 2017 Author Share Posted August 3, 2017 @Temechon Hi Temechon, when you merged your repo with babylonjs 1-2 days ago I think you accidentally reverted your changes about the __extend issue by probably not rebuilding the inspector bundle. So I'm using this file for now which is from the commit that solved the issue:https://raw.githubusercontent.com/Temechon/Babylon.js/a29aaa69dfea302610f676c00545829c65b85297/dist/preview release/inspector/babylon.inspector.bundle.js@Myjestic If you havn't solved the GetClassName issue yet I believe in your code you can do this as a temporary solution BABYLON.Tools.GetClassName = BABYLON.Tools.getClassName; Quote Link to comment Share on other sites More sharing options...
Temechon Posted August 4, 2017 Share Posted August 4, 2017 Hi @haestflod, __extends variables are now correctly defined in the bundle inspector in the main repo. Are you sure to use the correct one ? :https://github.com/BabylonJS/Babylon.js/blob/master/dist/preview release/inspector/babylon.inspector.bundle.js Thanks ! Quote Link to comment Share on other sites More sharing options...
Myjestic Posted August 4, 2017 Share Posted August 4, 2017 18 hours ago, haestflod said: If you havn't solved the GetClassName issue yet I believe in your code you can do this as a temporary solution BABYLON.Tools.GetClassName = BABYLON.Tools.getClassName; Thank you, that did it for now. Quote Link to comment Share on other sites More sharing options...
haestflod Posted August 4, 2017 Author Share Posted August 4, 2017 @Temechon The one at babylonjs repository works again, thanks! It still crashes on this error but I'll mark this thread as solved as the __extends issue is fixed! babylon.inspector.bundle.js:409 Uncaught TypeError: BABYLON.Tools.GetClassName is not a function at Function.t.GET_TYPE (babylon.inspector.bundle.js:409) at Object.format (babylon.inspector.bundle.js:408) at n._displayValueContent (babylon.inspector.bundle.js:409) at new n (babylon.inspector.bundle.js:408) at new n (babylon.inspector.bundle.js:409) at new n (babylon.inspector.bundle.js:410) at t._buildInspector (babylon.inspector.bundle.js:408) at new t (babylon.inspector.bundle.js:408) at DebugLayer._createInspector (<anonymous>:61488:35) at HTMLScriptElement.script.onload (<anonymous>:5607:21) Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 4, 2017 Share Posted August 4, 2017 can you make sure to install latest bjs version (3.1alpha) ? Quote Link to comment Share on other sites More sharing options...
haestflod Posted August 7, 2017 Author Share Posted August 7, 2017 Hi, I was on 3.0.7 and it's resolved in 3.1 alpha. I'll continue using this code snippet before I open the debugLayer until 3.1 is relased so the inspector script doesn't crash. if ( BABYLON.Tools.getClassName ) { BABYLON.Tools.GetClassName = BABYLON.Tools.getClassName; } 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.