ESM + JSDocs

Hello,

I’ve been experimenting with the new ESM support in the PlayCanvas editor:
PlayCanvas Editor Scene

In my project, I need to access an entity within a script. The entity is defined using JSDoc as pc.Entity. However, when I call pc.app.root.findByName(), it returns a pc.GraphNode instead of an pc.Entity.

This results in the following Type error:

Type 'GraphNode' is missing the following properties from type 'Entity': anim, animation, audiolistener, button, and 34 more.

I could disable type-checking for this file, but I’d like to know if there’s a proper way to resolve this issue. Has anyone encountered this before? Any insights would be appreciated!

Thanks!