Importing inspector in typescript cause failure if engine started with offscreen canvas

i tried to do this, but typescript is telling me import statements cannot be called from within an if statement - though i’m assuming my knowledge of typescript is the limiting factor here.

Dynamic importing is fully supported in typescript since 2.4. the syntax is a little different - Dynamic import() Expressions in TypeScript — Marius Schulz (not my tutorial, just something i found googling)

Hi @rdpeake just checking in if you’d like any more help?

Hello,

Using the async import method works reliably whilst using offscreen canvas. or should i say allows you to conditionally load the inspector so that it only loads when running in direct mode.

Would be good to mention this limit and solutions in the inspector documentation.