Jump to content
Search Community

cenzo

Members
  • Posts

    1
  • Joined

  • Last visited

Posts posted by cenzo

  1. On 8/29/2022 at 12:17 AM, AlexMKC said:

    My project works perfectly in the build, but when deploying it to a live website, gsap is having errors:

     

    Invalid property scrollTrigger set to Object

    Missing plugin? gsap.registerPlugin()

     

    I'm using the gsap 3.11

     

    My code looks like this, is there any obvious issue here? Again, it works perfectly in the build...

     

    import React, { useState, useEffect, useRef } from "react";
    import "./Home.css";
    import { gsap } from "gsap";
    import { ScrollTrigger } from "gsap/ScrollTrigger";
    gsap.registerPlugin(ScrollTrigger);
    import { Link, useLocation } from "react-router-dom";
    import { useMediaQuery, useTheme } from "@material-ui/core";

     

      useEffect(() => {
        gsap.to("body", {
          backgroundColor: "black",
          scrollTrigger: {
            toggleActions: "play pause resume reverse",
            trigger: backColor.current,
            start: "top center",
            markers: true,
          },
        });
        gsap.to(".fontStyle", {
          color: "#f9cdcd",
          scrollTrigger: {
            toggleActions: "play pause resume reverse",
            trigger: backColor.current,
            start: "top center",
          },
        });
     
        if (location.state?.scrolled) {
          scrollFun("projects");
        }
      }, []);

     

    Im having the same exact issue

×
×
  • Create New...