Uncaught TypeError: Cannot read properties of undefined (reading 'Debug') at webpack Universal Module Definition

I has a little TypeScript project with lit and BabylonJS.

When I trying to import the Inspector, I got an error in the browser’s console:

Uncaught TypeError: Cannot read properties of undefined (reading 'Debug')
    at webpack Universal Module Definition (universal Module Definition:9:1)
    at universalModuleDefinition:10:2

I think some mistake in the tsconfig.json or rollup.config.js may produces this error. But currently I don’t understand what I need to look at and how to fix it.

Here is the project:
_bug-debugger.zip (3.1 KB)

to reproduce, after the npm i run concurrently watch, sync and start, then open http://localhost:8000/

Could someone help me? :smiley:

Found one similar issue on the forum How to use Inspector with ES6 Modules
But no one advice helped me.

Also I tried to import debugger in this template GitHub - lit/lit-element-starter-ts: Sample component project using LitElement with TypeScript
but the error are the same

Have you checked Raanan’s template? RaananW/babylonjs-webpack-es6: Babylon.js basic scene with typescript, webpack, es6 modules, editorconfig, eslint, hot loading and more. Will even make coffee if you ask nicely. (github.com) comparing it to your project might help pinpoint the difference

2 Likes

Thanks, I’ll see it

this could also help, BabylonjsInkSample/src at master · sebavan/BabylonjsInkSample · GitHub it is all tree shooked in here.

1 Like