Closed Paper-Folding closed 1 year ago
Okay, the call stack(I analyzed with https://github.com/sokra/source-map-visualization):
https://github.com/greensock/GSAP/blob/472d4170d4aa3cceb8a3880d7cad700f22fbc545/src/CSSPlugin.js#L322
https://github.com/greensock/GSAP/blob/472d4170d4aa3cceb8a3880d7cad700f22fbc545/src/CSSPlugin.js#L1095
https://github.com/greensock/GSAP/blob/472d4170d4aa3cceb8a3880d7cad700f22fbc545/src/gsap-core.js#L2204
And it's so weird that the issue happens in CSSPlugin.js
, I did not even explicitly import CSSPlugin.js
in my source file, I only use:
import gsap from "gsap";
import Draggable from "gsap/Draggable";
in my source file, will this import CSSPlugin
, too?
If so, can I prevent using CSSPlugin?
Hm, that sounds odd. Can you please provide any (or all) of the following?:
I just can't imagine why that line would throw the error. Nobody else has reported anything similar. I'd love to see a demo, though.
And to answer your question about CSSPlugin, that's automatically included in the core because almost everybody ends up wanting to tween CSS-related values. If you truly have no such needs at all in your app, yes, you technically should be able to import gsap from "gsap/gsap-core" which would exclude CSSPlugin (but again, that's almost never a good idea). The fact that you're getting the error in that CSSPlugin file tells me that you actually are trying to animate something on a DOM element, likely CSS-related, so you shouldn't be excluding CSSPlugin.
I finally resolved this error, this error happens because my Draggable.js is using a low version cdn while gsap is the newest high version in my production site (using cdn, so I forget to update url for both of them). In development mode, I'm using npm so the version is always the latest, so that's way I can't catch a error in development mode.
Huh, very interesting. I still don't understand why having an old version of Draggable would cause that line to error in CSSPlugin. Are you sure things are resolved? I mean you should definitely be using a more recent version...I just want to make sure the real issue was resolved.
Huh, very interesting. I still don't understand why having an old version of Draggable would cause that line to error in CSSPlugin. Are you sure things are resolved? I mean you should definitely be using a more recent version...I just want to make sure the real issue was resolved.
Yes, it is resolved. From my user who faced this problem yesterday.
For the record, there was a regression in 3.12.0 that could cause an error like this (not from that line you mentioned though) if you create a Draggable, enable inertia, and then call disable() on that Draggable instance. It should be resolved in the next release, 3.12.2 due out soon. I just wonder if maybe that was the root cause here.
@Paper-Folding can you share any details about what exactly resolved it on your end? I don't think this had anything to do with GSAP specifically, but I'm curious about what solved the problem for you.
@Paper-Folding can you share any details about what exactly resolved it on your end? I don't think this had anything to do with GSAP specifically, but I'm curious about what solved the problem for you.
Well, if you insist.... Intertia plugin 3.11 does not compatible with Draggable 3.12 (especially when .kill
method is called on Draggable instance). That's all I have tested. And I really appreciate your work, I must apologize for being so vague above.
And I resolved the problem by removing Inertia Plugin, users weren't actually allergic to drag inertia a lot, they only care dragging.
Yes, that issue was resolved in 3.12.2 of Draggable as I mentioned above. If you become aware of any other issues, please do let us know.
Here is the final location that caused the error:
https://github.com/greensock/GSAP/blob/472d4170d4aa3cceb8a3880d7cad700f22fbc545/src/CSSPlugin.js#L322
I met a
RangeError: Maximum call stack size exceeded
on my production site, this issue does not happen very often, but it happened indeed.I must apologize that I can't provide a very detailed issue report now (because I can't locate where it is actual called in my code under a production mode), now I unminimized my code and add source map, once this issue happens again, I'll report more details here.