You need to import the plugins that you want to use in every file that you want to use them in. So the code at the top of the file should be:
import { gsap } from "gsap";
import { MotionPathPlugin } from "gsap/MotionPathPlugin";
import { TextPlugin } from "gsap/TextPlugin";
import { ScrollToPlugin } from "gsap/ScrollToPlugin";
gsap.registerPlugin(MotionPathPlugin, TextPlugin, ScrollToPlugin);
You can use the GSAP installation page, specifically the install helper, to help you get the correct formatting with your system.