You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the ESM build, app is part of the App-Base module scope and is initialised as part of the app startup. This means that
import{app}from'playcanvas'// app === null;
However, importing later it will resolve. This seems error prone and inconsistent with expectations with how imports work. Ideally this should be removed, but may be used by users. There needs to be a solution to migrate away from this.
The text was updated successfully, but these errors were encountered:
It doesn't really change between ES5/ESM. In either situation pc.app is null until it isn't, so pc.app.fire('someEvent') works once app is available. It's more a question of whether it should be exported
In UMD build
app
is added to the pc export which providespc.app
engine/src/framework/app-base.js
Line 97 in 2a805dd
In the ESM build,
app
is part of the App-Base module scope and is initialised as part of the app startup. This means thatHowever, importing later it will resolve. This seems error prone and inconsistent with expectations with how imports work. Ideally this should be removed, but may be used by users. There needs to be a solution to migrate away from this.
The text was updated successfully, but these errors were encountered: