Jump to content
Search Community

ScrollTrigger and splittext probelm in next js production build

JinoCarWash test
Moderator Tag

Recommended Posts

Hi, I am working on Next JS. and bought the club membership. This plugin (Scroll Trigger) is working fine on my local host but while making build/production I am facing these errors. 

  • First I have imported the plugins like this ( import {ScrollTrigger} from "gsap/dist/ScrollTrigger") i was working fine on local host but give errors on production build.
  • I have change this to ( import {ScrollTrigger} from "gsap/ScrollTrigger"), Still getting the error.
  • I've also tried some online solutions and Green Sock Forum solution but I haven't worked for me.

MicrosoftTeams-image (6).png

MicrosoftTeams-image (5).png

MicrosoftTeams-image (4).png

Link to comment
Share on other sites

Hi there!

 

Thanks for being part of club GreenSock

 

 

Next.js doesn't support ES Modules, so you would need to import the UMD files. I'm afraid I don't know why this would be different for production. Have you tried asking over on the Next.js Discord ?

 

import Flip from "gsap/dist/Flip"

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