Jump to content
Search Community

Annoying Non-Error (because I didn't catch it in the 3 hours I was banging my head on my desk)

Saul Rosenbaum test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Ever have one of those mornings?
Consider this a cautionary tale

 

I was knocking together what should have been a very quick loader for a kiosk (do we still call them that?)

I grabbed a starter file I had sitting around that had the following script tags

 

    <script src='https://cdnjs.cloudflare.com/ajax/libs/zepto/1.2.0/zepto.min.js'></script>
    <script src='https://cdnjs.cloudflare.com/ajax/libs/gsap/latest/TweenMax.min.js'></script>

 

Instead of 

 

    <script src='https://cdnjs.cloudflare.com/ajax/libs/zepto/1.0rc1/zepto.min.js'></script>
    <script src='https://cdnjs.cloudflare.com/ajax/libs/gsap/1.20.3/TweenMax.min.js'></script>

 

Now because I'm showing you both - the obvious error is... um...obvious, but it wasn't obvious to me and everything was fine and dandy - then the client showed up (with coffee and doughnuts) and the js errors started (screenshot of the console attached for your reference and bemusement) .

 

I placated the client while I tried to figure out what the issue was - took me 5 minutes to create a working pen of just the part that was tossing the errors - but another 2 hours to realize why, luckily my studio cat entertained the client to the point of them losing track of time me, allowing me to fix everything to their satisfaction.


really the only change needed was the script tag, for whatever reason it was chocking on lines 7-10 (the rotation function)
 

I realize no one else will likely have this issue, ever - but I wanted to document it anyhow, this is the kind of micro-minutia that gets me - it's almost never the actual work.

Screen Shot 2018-03-29 at 1.01.29 PM.png

See the Pen ff9fa3b3e5fe650fb7d723e2582b5eb9?editors=0010 by sauldraws (@sauldraws) on CodePen

  • Like 4
Link to comment
Share on other sites

HI and welcome to the GreenSock forums,

 

Ugh, sounds like the wrong way to do start the day. We've all been there.

Yeah, it looks like the problem is that cdnjs returns version 1.18.0 of TweenMax when you use /latest

We reported the problem to them a while ago but they decided not to fix it.

 

It is very frustrating. We stopped using /latest a while ago but we probably still have some demos that pull it in.

 

Since function-based values weren't added until version 19 that's why things weren't working.

 

Sorry to hear of the rough start, hope you got to at least enjoy some donuts and things go smoother from here.

 

 

  • Like 4
Link to comment
Share on other sites

For me the real takeaway from this is don't try to throw it together just before a meeting with a client.

 

I run into dev problems too that sometimes stymie me for a ridiculous amount of time, only to turn out to be something obvious I missed right from the start.

 

Though I guess in this case it was the cdn at fault not your work, things like this can still happen anytime, so it's a lot better to make sure it's ready to show first before setting a meeting.

  • Like 4
Link to comment
Share on other sites

47 minutes ago, Saul Rosenbaum said:

I realize no one else will likely have this issue, ever 

 

I thinks it's good you posted your experience because this has been the issue in several threads. I just answered one a few days ago about an infinite tween in a timeline which works perfectly in 1.20.0 or later, but the OP was using the /latest/ so it wasn't working correctly. 

 

Sorry about your lousy morning, but thanks for pointing others to a solution. 

 

Happy tweening.

:)

 

  • Like 5
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...