Jump to content
Search Community

Greensock club member error building nextjs project

JamesGrubb test
Moderator Tag

Recommended Posts

Hi, im have install gsap via npm following directions for greensock members using

npm install gsap@npm:@gsap/simply

I import it into my component
```

import drawSVG from 'gsap/DrawSVGPlugin';
gsap.registerPlugin(drawSVG);


```
An it seem to be working fine. When i push to git and build the project through Verce'ls hosting I get the following build error.
 

Module not found: Can't resolve 'gsap/DrawSVGPlugin' in '/vercel/path0/components/Hero'

 

Any ideas please

 

Link to comment
Share on other sites

We'd prefer you not as anyone could just snag that file. It would be better to make your repo private, or use .npmrc method. I don't have a good answer for on how to fix something works locally, but not on Vercel. It might be worth reaching out to them and seeing if they have a solution as it's their platform so they would have a better understanding of what the issue is.

 

Another related thread...

 

 

  • Like 1
Link to comment
Share on other sites

  • 1 year later...
import { useEffect, useRef } from "react";

import { gsap } from "gsap/dist/gsap";
import { SplitText } from "gsap/dist/SplitText";

gsap.registerPlugin(SplitText);

export default function HeroFadeText() {
  // Grab a reference to the component to split the text up.
  const heroText = useRef(null);

  useEffect(() => {}, []);
  return (
    <div>
      <p ref={heroText}></p>
    </div>
  );
}

 

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