omarel Posted March 14, 2022 Share Posted March 14, 2022 I'm trying to setup a Scrolltrigger demo in React/NextJs to get some assistance on the forums, but ScrollTrigger doesn't seem to even load on CodeSandbox using CodeSandbox's NextJs template: Per the Greensock docs for CodeSandbox I installed gsap and gsap-trial, but I keep getting this error on CodeSandbox SyntaxError: Unexpected token 'export' Please see here: https://codesandbox.io/s/black-tdd-rncum0?file=/components/bigphoto.js Link to comment Share on other sites More sharing options...
Solution OSUblake Posted March 14, 2022 Solution Share Posted March 14, 2022 NextJS does not support ES Modules so you'll need to use the UMD files located in the dist folder. import { ScrollTrigger } from "gsap/dist/ScrollTrigger" 3 Link to comment Share on other sites More sharing options...
omarel Posted March 14, 2022 Author Share Posted March 14, 2022 10 hours ago, OSUblake said: NextJS does not support ES Modules so you'll need to use the UMD files located in the dist folder. import { ScrollTrigger } from "gsap/dist/ScrollTrigger" Thank you! That worked. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now