Vite > ~b24 not resolving BabylonJS imports anymore... what's going on here?

Babylon 4.2.0 is suddenly breaking quite dramatically in the more recent versions of Vite. Here’s a minimal reproduction and more detail:

I’m completely lost here. Some of the errors I’ve gotten resemble some I’ve seen in the forums (“you must import StandardMaterial” when trying to use the PhotoDome, for example), but the solutions so far haven’t worked.

Has anyone using Vite (with Vue, React, etc.) run into anything like this? Or can someone with a better understanding of the ES build see what’s going on here with Vite?

I filed this under a “bug,” but I really don’t know if it’s BabylonJS’s bug, or a documentation bug, or a Vite bug, or a me bug. Hopefully a me bug, since that’s the easiest to fix usually :).

Followup… it appears it may be a Vite bug that will be fixed in the next release… crossing fingers!

1 Like