GSAP - Javascript: The specifier “gsap/dist/gsap” was a bare specifier, but was not remapped to anything

36 Views Asked by At

I am trying to use the JavaScript GSAP library in a web project (running on Python Flask framework). I have this animate.js script, with the following content:

import { gsap } from "gsap/dist/gsap";
    
import { ScrollTrigger } from "gsap/dist/ScrollTrigger";
import { MotionPathPlugin } from "gsap/dist/MotionPathPlugin";
import { TextPlugin } from "gsap/dist/TextPlugin";


gsap.registerPlugin(ScrollTrigger,MotionPathPlugin,TextPlugin);

I generated the above from the GSAP installation docs as a UMD (universal module definition) import. However, when I attempt to run the script (on Firefox), I get this error Uncaught TypeError: The specifier “gsap/dist/gsap” was a bare specifier, but was not remapped to anything. Relative module specifiers must start with “./”, “../” or “/”.

I have tried switching between UMD and ESM imports, but I still get the same error message. I need help understanding the exception message and how I can resolve the error.

0

There are 0 best solutions below