Jump to content
Search Community

gsap/ScrollTrigger with next-transpile-modules

mrcrunchy test
Moderator Tag

Recommended Posts

Hello there!

I'm using next-transpile-modules  with gsap but I'm getting some deprecated warnings/infos when I run my code.

The warning is:

 

"next-transpile-modules - DEPRECATED - fallbackingto previous module resolution system for module 'gsap/ScrollTriger', you can now just pass the name of the package to transpile and it will detect its real path without you having to pass a sub-module."

 

I have file next.config.js with code:

 

const withImages = require("next-images");
const withTM = require("next-transpile-modules")([
  "gsap",
  "gsap/ScrollTrigger",
]);
 
module.exports = withImages(withTM());

 

and I'm importing gsap and ScrollTriger like this:

 

import gsap from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";

 

I have tried to import it like : './ScrollTrigger' and 'gsap' and even 'ScrollTrigger' but nothing seems to work.

Hope someone knows the solution to this.

Thank you, have a nice day

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