Jump to content

scene.debugLayer.show throws error


haestflod
 Share

Recommended Posts

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)

 

Link to comment
Share on other sites

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!!

Link to comment
Share on other sites

@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;

Link to comment
Share on other sites

@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)

 

Link to comment
Share on other sites

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;
}

 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...