Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
mush

Nextjs and gsap

Recommended Posts

Hi all,

I did some animations with gsap and scrollscene and it working fine when I run the development environment but when I build the project and visit the page I get errors in the console.

Uncaught TypeError: Cannot assign to read only property 'x' of object '#<HTMLImageElement>'

I tried to add a polyfill like the scollscene docs say and I used next-transpile-modules and transpiled gsap like this but it didn't work.

 

const withTM = require('next-transpile-modules')(['gsap']);

Any suggestions? 
 

Link to comment
Share on other sites

Hey mush and welcome to the GreenSock forums!

 

We recommend using the official scroll plugin for GSAP called ScrollTrigger. We believe it to be easier to use and more powerful than other scrolling libraries. I wrote up a post with an overview of scroll technologies with some comparisons of the features in this CSS-Tricks post.

 

As for GSAP in Next, have you already seen this thread?

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Hi @ZachSaucier

 

I'm new to gsap world and I didn't know that there a plugin for triggering the scroll, I used it instead of scrollscene and it really cool and easy to use.

 

You can take a look at the page that I did it using GSAP Open Screenplay.
It still needs some improvements.


Thank you.

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.
×