BabylonJS / Babylon.js

Babylon.js is a powerful, beautiful, simple, and open game and rendering engine packed into a friendly JavaScript framework.
http://www.babylonjs.com
Apache License 2.0
22.75k stars 3.39k forks source link

An error occurs when 'const' is added to the enum export and the tsconfig.json setting is 'isolatedModules': true'. #15238

Closed wisdomstar94 closed 1 day ago

wisdomstar94 commented 3 days ago

Commit that caused the problem

https://github.com/BabylonJS/Babylon.js/commit/a6dc77a5c1cbab71b4ba8559bb5d8269a0bda811

Description

  1. Suppose that the options for tsconfig.json are.
    image
  2. The typecript displays an error when using the PhysicsMotionType enum as follows.
    image



I don't think it's a good idea to simply modify the option "isolatedModules" to false, for example, because Next.js, a much-used framework, recommends using the option "isolatedModules" as true.

This is my personal opinion and I would like to hear from the contributors.

kai-dorschner-twinsity commented 2 days ago

I still face this error with MaterialPluginEvent in latest version 7.13.1 For now the only solution is to roll back to 7.12.0

RaananW commented 2 days ago

let me find a solution for this. This is a typescript types-only issue, as the enums are exported correctly. Will probably need to adjust the types exported.

kai-dorschner-twinsity commented 59 minutes ago

updated to 7.13.2, now everything works, great job 😚