Jump to content
GreenSock

dialformonkey

ScrollSmoother undefined on nested route load

Recommended Posts

Hi. Ive encountered the error below when directly loading a nested route. No errors if i navigate to said nested routes from the main page.

 

Tried to debug. checked that all the wrappers are loading on the nested routes as well. 

Screenshot 2023-01-21 at 3.36.12 PM.png

Link to comment
Share on other sites

Solution was registering ScrollTrigger as well

Link to comment
Share on other sites

Hi,

 

Actually in this cases, there is no need to register a plugin more than once. It's always a good idea to register the plugins you'll use across your app at a top level file that always load, regardless of the route the user goes to, like a layout, a start page or something like that. Then just importing the plugin should be enough.

 

In Next I always use the _app.js file for that as well as the global styles.

 

Happy Tweening!

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×