Skip to content

Javascript doesn't always get executed #534

Description

@Stelikas

I recently started using Turbolinks with pace.js to handle the initial page load and i'm facing a weird issue where sometimes Javascript doesn't get executed with no errors.

Pace.once('done', () => {
  
      var tl = gsap.timeline();

        tl.set('html, body', {
            overflowY: 'unset'
        })
        .set('#app', {
            visibility: 'visible', 
        })
        .add('do')
        .to('.turbo__lines', {
            stagger: .3,
            height: '0%'
        })
        .to('.turbo__logo, .__loader', {
            duration: .3, 
            opacity: 0
        }, 'do')
        .to('.turbo__loader', {
            visibility: 'hidden'
        }).pause();

          tl.play(); //<---Sometimes it doesn't fire
          console.log(tl) //<----Always fires
        
})

I honestly can't find a reason on why this is happening, i get no errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions