SSR compile errors - Tickets always closed

I’ve spent weeks getting this to work, I am very close to giving up on ionic.

self is not defined. If self is declared as win, then it will give constructor error.

And these tickets always seem to be closed. It seems like people are having issues and more on SO.

And I am following this

I’ve also upgraded, downgraded Angular version using 9,10,11,12, node 14,15,16, ionic 5.