Jump to content
Search Community

Errors on prod version, works fine in dev

modulareverything test
Moderator Tag

Recommended Posts

I'm working on a little animation at the moment and I have it working pretty nicely when it's running locally.

 

When I package it and deploy it however I'm hit with errors. I thought this might have something to do with gsap trying to interact with the page before it had loaded and it throwing an error, but that doesn't explain why one of the animations is actually working fine (but the others aren't).

 

Here's the bugged production version;

https://hult-network.vercel.app/

 

And a link to the code;

https://github.com/chrish-d/GSAP-Connected-Nodes

 

If you pull the code, this should get you going; npm install && parcel index.html

 

Lastly I've attached a screenshot of what it should look like.

 

Thanks for any help

Screenshot 2020-07-26 at 15.42.03.jpg

Link to comment
Share on other sites

I don't have time right now to download all your code and set up a build directory, but your live version is erroring on a line that has nothing to do with GSAP: 

pathA.setAttribute(...)

 

It's saying that pathA is undefined. So it looks like when you set that variable and do the querySelector(), it doesn't exist. Have you tried troubleshooting that? Maybe console.log() what that is and why it's returning undefined. Maybe your code is running before those DOM nodes are defined? Maybe window or document isn't defined at that point? 

  • Like 2
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...