I'm running React/Next.js on my local machine. When I do this:
import { SplitText } from "gsap/SplitText"
Then do
npm run dev
Then I get this error:
error - .../node_modules/gsap/SplitText.js:12
import { emojiExp, getText } from "./utils/strings.js";
^
SyntaxError: Unexpected token {
If I change my import to the following using the ol’ dist folder trick, we're all good.
import { SplitText } from "gsap/dist/SplitText"
gsap.registerPlugin(SplitText)
I can liv
It is strange because I can deploy to Vercel with:
import { gsap } from "gsap"
No problem, no need for /dist. I deploy and everything builds and animates, but for SplitText is needs /dist. Curious why that is?
For deployment, you're right it is something with the member plugins.
I'm doing the private npm route so it is probably getting tripped up with step 4 where you have to do `gsap@npm:@gsap/<package>` the first time. During a Vercel deployment, it j