Sign in to follow this  
haestflod

scene.debugLayer.show throws error

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)

 

Share this post


Link to post
Share on other sites

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

 

 

Share this post


Link to post
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!!

Share this post


Link to post
Share on other sites

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

 

Share this post


Link to post
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;

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
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)

 

Share this post


Link to post
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;
}

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.