I am importing GSAP and ScrollTrigger to a local install of create-react-app. The GSAP import works fine but ScrollTrigger only works with the skypack import. See code below.
I've tried with and without curly braces. According to docs and other examples, I can't see a problem with the code.
Does anyone have an idea what might be happening? I have version 8.6.0 of gsap/ScrollTrigger installed. Do I need to add a dependency to package.json?
import { gsap } from "gsap";
// import { ScrollTrigger } from "gsap/ScrollTrigger";
// import gsap from "https://cdn.skypack.dev/gsap@3.11.0";
import ScrollTrigger from "https://cdn.skypack.dev/gsap@3.11.0/ScrollTrigger";
export default function App() {
gsap.registerPlugin(ScrollTrigger);
...
}