Initial svg height before window resize

There must a race condition somewhere in your code. Can you share a snippet with us?