When is OnSuccess called in Unity WebGl

I am using new WebGl loader introduced in Unity 2020.1.
New instateing method looks like this:
createUnityInstance(canvas, config, onProgress).then(onSuccess).catch(onError);

I am trying to communicate with JS at the beginning of my program. Unfortunately, my Code invoking JS function is invoked before I get OnSuccess promise object, so I can’t talk back to Unity because I have no reference to it yet.

Adding 2 frames latency does not solve the problem.

It worked for previous WebGl loader.

When is OnSuccess called?

What solved it for me was postponing my calls to Javascript from Awake to Start. It appears that Awake is called on all GameObjects before onSuccess is invoked.