react-gsap
react-gsap copied to clipboard
Can't import the script on a react online
getting SyntaxError: The requested module '/-/[email protected]/dist=es2020,mode=imports/unoptimized/dist/ScrollTrigger.js' does not provide an export named 'ScrollTrigger'
using it like import { PlayState, Tween } from "https://cdn.skypack.dev/react-gsap"
any ideas?
I have no experience with skypack. The issue seems to be the es5 import here: https://github.com/bitworking/react-gsap/blob/master/packages/react-gsap/src/tools/ScrollTrigger.tsx#L3
I had to do it, else you'd have to transpile node_modules if you want to use react-gsap in an es5 environment. Maybe you can fix that by using the dist parameter? https://docs.skypack.dev/skypack-cdn/api-reference/lookup-urls#forced-browser-support
I've tried them all with no luck, even tried the ?dts
as the project is in Typescript but nothing changed. :(