Yeah, i've tried a lot of solutions posted by other people. The solution provided in the link above only works if you want to load GSAP via CDN.
For this project we are using loadable components (https://loadable-components.com/). So basically we only want to load GSAP for components that are using it. The example code provided on the installation page works in every component.
Then, for SSR you need to check if the code is running on the client or server:
That's why the hasWindow check is implemented. Which looks like this:
So the gsap.registerPlugin function should not be called when running on the server? But it is, so am I missing something here?