Hersir Posted September 19, 2018 Share Posted September 19, 2018 Hi, tried to open inspector by: this.getScene().debugLayer.show(); but that produces following errors: bootstrap:129 Uncaught TypeError: Cannot read property 'bind' of undefined at bootstrap:129 at bootstrap:137 at universalModuleDefinition:9 at universalModuleDefinition:1 Uncaught TypeError: Cannot read property 'Inspector' of undefined at t.webpackJsonp.1921.t._createInspector (babylon.js:1) at HTMLScriptElement.n.onload (babylon.js:1) I am using babylonjs rc-1, and webpack for packing. I am missing some new configs ?, as it used to work 2-3 versions ago could be related to this ? Thank you Quote Link to comment Share on other sites More sharing options...
Hersir Posted September 19, 2018 Author Share Posted September 19, 2018 Looks like inspector script is loaded, but global INSPECTOR is still undefined, could be related to fact that I use, webpack 3, but inspector is bundled with webpack 4 Quote Link to comment Share on other sites More sharing options...
Hersir Posted September 19, 2018 Author Share Posted September 19, 2018 Tried to use npm version of inspector but there is same error about bind. Off topic npm inspector package is missing dependencies, (babylonjs-gui, babylonjs-loaders, babylonjs-serializers), would be nice to add it in package.json of inspector so they are auto installed, as it doesn't work without them. Quote Link to comment Share on other sites More sharing options...
Sebavan Posted September 19, 2018 Share Posted September 19, 2018 Pinging @RaananW for help on this one ? Quote Link to comment Share on other sites More sharing options...
RaananW Posted September 19, 2018 Share Posted September 19, 2018 Hi @Hersir, What environment is running your code? Browser? Can you check if "https://preview.babylonjs.com/inspector/babylon.inspector.bundle.js" is being downloaded in the background for me? You are right about the dependencies, this is being taken care of Another small request (with huge thank-you, of course): Can you try, instead of the .show function, to create your own inspector? Import Inspector from the package, and: new Inspector(this._scene, false, 0, null); Quote Link to comment Share on other sites More sharing options...
Hersir Posted September 20, 2018 Author Share Posted September 20, 2018 Hi @RaananW so all in order System: macOS High Sierra 10.13.6 Browser: Chrome 69.0.3497.100, Safari 12.0, Firefox 62.0 Webpack: 3.12.0 Babylonjs: 3.3.0.-rc.1 Inspector: 3.3.0.-rc.1 Tried: import { Inspector } from "babylonjs-inspector"; new Inspector(this._scene, false, 0, null); and import "babylonjs-inspector"; scene.debugLayer.show(); both produce same bind error at start of load, dont even get to new Inspector or show: Uncaught TypeError: Cannot read property 'bind' of undefined at universalModuleDefinition:1 at universalModuleDefinition:1 at webpackJsonp.2525 (universalModuleDefinition:1) at Object.2525 (universalModuleDefinition:1) at __webpack_require__ (bootstrap 5313bedd0a39528998e1:54) at __webpack_require__ (bootstrap 5313bedd0a39528998e1:54) at __webpack_require__ (bootstrap 5313bedd0a39528998e1:54) Without import, just using show: File https://preview.babylonjs.com/inspector/babylon.inspector.bundle.js is loaded successfully, but global INSPECTOR is still undefined when it tries to show, because of bind error before. Can give more info if needed Quote Link to comment Share on other sites More sharing options...
RaananW Posted September 20, 2018 Share Posted September 20, 2018 Interesting issue. I wonder if it is really the webpack version or something different. I am checking this, and will update here soon. Thanks a lot for the info! Quote Link to comment Share on other sites More sharing options...
RaananW Posted September 20, 2018 Share Posted September 20, 2018 @Hersir - Say, can you try including babylonjs-gui, loaders and serializers in your build and let me know if there is a different error? Quote Link to comment Share on other sites More sharing options...
Hersir Posted September 21, 2018 Author Share Posted September 21, 2018 @RaananW You mean like this ? import "babylonjs-gui"; import "babylonjs-loaders"; import "babylonjs-serializers"; if yes than worked fine, launched without error Quote Link to comment Share on other sites More sharing options...
RaananW Posted September 24, 2018 Share Posted September 24, 2018 these are required ependencies, if you use the module-inspector. I added those as dependencies in package.json, and they should be installed next time you update the inspector to the latest package Quote Link to comment Share on other sites More sharing options...
Hersir Posted September 25, 2018 Author Share Posted September 25, 2018 @RaananW sorry wrong wording from my side, I meant that import "babylonjs-gui"; import "babylonjs-loaders"; import "babylonjs-serializers"; dont have any errors if included, but import "babylonjs-inspector"; still have bind error as before I also tried rc4 but have same issue, and `babylonjs-serializers` is still missing if inspector is installed from npm. I would bet on webpack version differences ,as cold be that dependency bundling was changed from wp3 to wp4. Quote Link to comment Share on other sites More sharing options...
Guest Posted September 25, 2018 Share Posted September 25, 2018 Well the dependencies are in now: https://github.com/BabylonJS/Babylon.js/blob/master/dist/preview release/inspector/package.json#L31 I will add the serializers as well Quote Link to comment Share on other sites More sharing options...
Guest Posted September 25, 2018 Share Posted September 25, 2018 Can you just make sure to clean your node_modules folder and try again? Quote Link to comment Share on other sites More sharing options...
Hersir Posted October 22, 2018 Author Share Posted October 22, 2018 Ok now can confirm it was webpack version missmatch now after upgrade to webpack 4 it works 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.