Jump to content
Search Community

Nextjs and gsap

mush test
Moderator Tag

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

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.
×
×
  • Create New...