Marcello Posted August 22, 2021 Share Posted August 22, 2021 I have a Next.js/React project with typescript and Storybook: when using Scrolltrigger.matchmedia() function the component always give an error when running inside Storybook: _win is undefined matchMedia@http://localhost:6006/vendors~main.d3f7aa1f55228e485314.hot-update.js:1541:10 Removing matchmedia it all works as expected, but I need it in the project, this is very upsetting... You can find the demo code here on github: https://github.com/marcello-palmitessa/gsap-scrolltrigger-issues-demo Link to comment Share on other sites More sharing options...
GreenSock Posted August 22, 2021 Share Posted August 22, 2021 I bet you forgot to register the ScrollTrigger plugin 🙂 gsap.registerPlugin(ScrollTrigger); Link to comment Share on other sites More sharing options...
Marcello Posted August 22, 2021 Author Share Posted August 22, 2021 OMG you're right! I forgot that in Storybook the component are not wrapped by the _app component, where I put the registerplugin!! Thank you!!! 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now