question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

JS stops working after the first transition to another page

See original GitHub issue

#288 # Description

When built, one transition to another page ruins all JavaScript — I can’t go back or switch to another page, or animations stop working. This happens only on desktop.

In console, you can see:

Uncaught (in promise) DOMException: Failed to execute 'appendChild' on 'Node': This node type does not support this method.
    at Object.appendChild (https://sergeyfilimonovcom-jb23svs5l.now.sh/assets/js/app.5400ccbf.js:7:40392)
    at p (https://sergeyfilimonovcom-jb23svs5l.now.sh/assets/js/app.5400ccbf.js:7:52966)
    at f (https://sergeyfilimonovcom-jb23svs5l.now.sh/assets/js/app.5400ccbf.js:7:52703)
    at h (https://sergeyfilimonovcom-jb23svs5l.now.sh/assets/js/app.5400ccbf.js:7:53049)
    at E (https://sergeyfilimonovcom-jb23svs5l.now.sh/assets/js/app.5400ccbf.js:7:56391)
    at E (https://sergeyfilimonovcom-jb23svs5l.now.sh/assets/js/app.5400ccbf.js:7:56326)
    at E (https://sergeyfilimonovcom-jb23svs5l.now.sh/assets/js/app.5400ccbf.js:7:56326)
    at E (https://sergeyfilimonovcom-jb23svs5l.now.sh/assets/js/app.5400ccbf.js:7:56326)
    at E (https://sergeyfilimonovcom-jb23svs5l.now.sh/assets/js/app.5400ccbf.js:7:56326)
    at a.__patch__ (https://sergeyfilimonovcom-jb23svs5l.now.sh/assets/js/app.5400ccbf.js:7:56749)
app.5400ccbf.js:7 TypeError: Cannot read property '_isDestroyed' of undefined
    at destroy (app.5400ccbf.js:7)
    at w (app.5400ccbf.js:7)
    at w (app.5400ccbf.js:7)
    at a.__patch__ (app.5400ccbf.js:7)
    at a.t.$destroy (app.5400ccbf.js:7)
    at destroy (app.5400ccbf.js:7)
    at w (app.5400ccbf.js:7)
    at a.__patch__ (app.5400ccbf.js:7)
    at a.t.$destroy (app.5400ccbf.js:7)
    at destroy (app.5400ccbf.js:7)

Steps to reproduce

Go to https://sergeyfilimonovcom-jb23svs5l.now.sh and surf around the website. You are going to notice that routing will not be working after the first transition.

If you delete <Messenger/> from https://github.com/sergeyfilimonov/sergeyfilimonov.com/blob/master/src/layouts/Default.vue the problem goes away but I can’t get WHY. Sometimes it is working, sometimes not. For instance, if you just move the component right after <div class"layout"> the bug is gone, here is the proof: https://sergeyfilimonovcom-bd6stk8jn.now.sh. If you move it back, right before </div> it stops working.

You can see the repo here https://github.com/sergeyfilimonov/sergeyfilimonov.com

Environment


Libs:
- gridsome version: 5.0.4

Browser:
- [x] Chrome (desktop) version XX
- [x] Safari (desktop) version XX
 
For Tooling issues:
- Node version: 8.12.0 
- Platform:  Mac

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
sergeyfilimonovcommented, Apr 9, 2019

@hjvedvik I wrote above:

For instance, if you just move the [Messenger] component right after <div class"layout"> the bug is gone, here is the proof: https://sergeyfilimonovcom-bd6stk8jn.now.sh. If you move it back, right before </div> it stops working.

Now I placed it back to </div> and have no problems with routing and other stuff! It seems adding:

chainWebpack (config) {
    config.mode('development')
  }

in the module.exports of gridsome.config.js really helped but I don’t know why. Thanks!

0reactions
ricardov03commented, Oct 13, 2020

@hjvedvik I wrote above:

For instance, if you just move the [Messenger] component right after <div class"layout"> the bug is gone, here is the proof: https://sergeyfilimonovcom-bd6stk8jn.now.sh. If you move it back, right before </div> it stops working.

Now I placed it back to </div> and have no problems with routing and other stuff! It seems adding:

chainWebpack (config) {
    config.mode('development')
  }

in the module.exports of gridsome.config.js really helped but I don’t know why. Thanks!

Sorry, Can anybody help me to figure out why config.mode(‘development’) it’s no working in the build for me?

Read more comments on GitHub >

github_iconTop Results From Across the Web

JS content not working after a page transition using Barba.JS
It doesn't get reinitialised once you transition from one page to another. This means that when you transition to another page, all JavaScript- ......
Read more >
Page Transitions with JavaScript & CSS For Beginners
Learn how to transition between web pages using basic javascript and css. We use generic CSS animations / transitions mixed with the power ......
Read more >
Advanced page transitions with Next.js and Framer Motion
Here's a look at how to use Next.js and Famer Motion to apply subtle, elegant page transitions that add personality and style to...
Read more >
JavaScript - Bootstrap
For simple transition effects, include transition.js once alongside the other JS files. If you're using the compiled (or minified) bootstrap.js , there is ......
Read more >
transition | CSS-Tricks
For example, the following demo transitions on hover, but not on hover off: HTML; CSS. Result; Skip Results Iframe.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found