question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Importing inspector into es6 bundle overrides validate setting on SceneLoader

See original GitHub issue

Repro packages:

    "@babylonjs/core": "5.0.0-alpha.20",
    "@babylonjs/inspector": "5.0.0-alpha.20",
    "@babylonjs/loaders": "5.0.0-alpha.20",

add import "@babylonjs/inspector" into your bundle

use the following code snip

SceneLoader.OnPluginActivatedObservable.add(function (loader) {
    loader.validate = false;
    loader._validate = () => {
        console.log("loader validate is: ", loader.validate)
    }
})

Loader validate will be true when inspector is present in the bundle.


We have url parameters we use on dev builds to control bringing the inspector up or not. For now setting _validate on the loader to an empty function gets around the problem.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
deltakoshcommented, May 13, 2021

Ok done. Only Sandbox will enable it 😃 Undefined elsewhere

0reactions
deltakoshcommented, May 20, 2021

Sure we can!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Script tag for meshopt_decoder is getting added for every glb
Yep will do Importing inspector into es6 bundle overrides validate setting on SceneLoader · Issue #10343 · BabylonJS/Babylon.js · GitHub.
Read more >
How to override Model importer inspector. - Unity Forum
Basically I want to add a checkbox to the inspector, that will determine whether or ... then do a check when overriding the...
Read more >
Classes and Modules | Advanced JavaScript
Modules in ES6 introduced two new keywords, export and import . These keywords allow us to make certain classes and variables publicly available...
Read more >
ECMAScript modules | Node.js v19.3.0 Documentation
js' or '../config.mjs' . They refer to a path relative to the location of the importing file. The file extension is always necessary...
Read more >
ES6 browser support: is it time to rethink bundling? - Contentful
With browsers starting to implement ES6 modules, ... The Webpack configuration to create this bundle is relatively straightforward.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found