Scully: Failed to execute 'removeChild' on 'Node'

Created on 13 Sep 2020  路  6Comments  路  Source: scullyio/scully

I dont know why this error below sometimes happens when I navigate between posts. When this happens, the url change, but not the post content. Anybody knows the reason?
ERROR DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.

bug

Most helpful comment

Ok, I did see the problem.
Because of the way you set up your structure this line in your blog-post-omponent.html is causing this:

<app-blog-related-posts [relatedPosts]="postService.relatedPosts"></app-blog-related-posts>

if you move that to the parent of that component, your problem is fixed.

All 6 comments

@nhaancs No, I didn't hear of this issue yet.
If you can provide a reproduction, we will fix it.

@SanderElias Yeah,
You can clone this repo: https://github.com/nhaancs/ngx-scully-blog
Check out branch nhannguyendacoder
I use this command to build: ng build --prod && npm run scully && npm run scully:serve

First issue

  1. After build, go to route http://localhost:1668/blog
  2. Click on the first post
  3. Click on "Home" on the top navigation
  4. Click on the first post again
    => This error happens: ERROR DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node

Second issue

  1. After build, goto route http://localhost:1668/blog
  2. Click on the first post
  3. Then on the Categories widget on the right, hover on the 4th category name (HTML CSS), you will see the link is http://localhost:1668/blog?c=html-css
  4. Click on the category
    => Error: It first navigate to route http://localhost:1668/blog?c=html-css, but then the url automatically updated to http://localhost:1668/blog and clear all the query params.

As I run the Angular version, both errors above will not happen.

Btw, this error below sometimes happens on production with the code I setup Facebook pixel on my site. Do you know any possible reasons.
VM30 1637124039759653:30 Uncaught TypeError: fbq.registerPlugin is not a function

Thank you.

I checked out your sample.
when you upgrade to the current release of Scully, there is _no_ error.
just run npm i @scullyio/ng-lib @scullyio/scully

@SanderElias I upgraded follow your instructions but the errors still happen. Did you check out branch nhannguyendacoder?

Ok, I did see the problem.
Because of the way you set up your structure this line in your blog-post-omponent.html is causing this:

<app-blog-related-posts [relatedPosts]="postService.relatedPosts"></app-blog-related-posts>

if you move that to the parent of that component, your problem is fixed.

@SanderElias yeah, that's work! Thanks for your help 馃挴

Was this page helpful?
0 / 5 - 0 ratings