basementstudio / scrollytelling

A library for creating Scrollytelling animations, powered by React & GSAP.
http://scrollytelling.basement.studio
Other
1.13k stars 33 forks source link

Breaking Change with latest GSAP versions #33

Closed Duality1k closed 1 year ago

Duality1k commented 1 year ago

I installed latest gsap and scrollytelling versions, and after 2 hours trying to fix it i figured out the issue relies on scrollytelling side, as its trying to resolve frmo gsap/dist/ScrollTrigger when it should be gsap/ScrollTrigger or gsap/ScrollTrigger.js;

code:

import * as Scrollytelling from '@bsmnt/scrollytelling';
import Lenis from '@studio-freight/lenis';
import gsap from 'gsap'
import ScrollTrigger from 'gsap/ScrollTrigger'

output:

ERROR in ./node_modules/@bsmnt/scrollytelling/dist/index.mjs 56:0-52
Module not found: Error: Can't resolve 'gsap/dist/ScrollTrigger' in 'C:\Users\veil3\Desktop\Sentry\sentrysolutions.org\node_modules\@bsmnt\scrollytelling\dist'
Did you mean 'ScrollTrigger.js'?
BREAKING CHANGE: The request 'gsap/dist/ScrollTrigger' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
julianbenegas commented 1 year ago

hey @KeUnstackDetachProcess, really sorry about that — i'll check this out this week.

julianbenegas commented 1 year ago

hey @KeUnstackDetachProcess, i've changed the import from gsap/dist/ScrollTrigger to gsap/ScrollTrigger on v 0.2.0 — can you tried now?

liho00 commented 1 year ago

same error in v0.2.0

image image
julianbenegas commented 1 year ago

thanks @liho00 — we seem to have an issue on how GSAP is imported on different environments (cjs vs esm).

i now implemented a fix for our different bundles. can you check? on v 0.2.1

liho00 commented 1 year ago

@julianbenegas I installed @bsmnt/scrollytelling: ^0.2.4, and its working. Thank you for the great library, I am still new and learning of this library, hope able to build great product with this library.