I had similar problem after upgrade gsap to v3 on my next.js project, when run yarn build all animations stopped working (any errors, console was clear just site was broken). In yarn dev mode everything works quite smooth. I had to update timelines to new syntax to make it working fine after yarn build
From:
import { TimelineMax } from 'gsap'
...
this.linksTween = new TimelineMax({ paused: true })
...
componentDidMount() {
this.linksTween.to(
this.refText.current,
0.5,
{
fill: "#ffffff"
},
)
}
To:
import gsap from 'gsap'
...
this.linksTween = gsap.timeline({ paused: true })
...
componentDidMount() {
this.linksTween.to(
this.refText.current,
{
fill: "#ffffff",
duration: 0.5
},
)
}