Failed to execute 'removeChild' on 'Node'

256 views
Skip to first unread message

Stephen Marek

unread,
Feb 12, 2018, 7:21:42 PM2/12/18
to mod-pagespeed-discuss
I just started using mod_pagespeed for my Centos Apache server, and I'm getting this error logged in Chrome for all of ONE site's pages. Another site I host with the same server is fine, so clearly it is a conflict with the one site's html/css/js.


Uncaught DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
    at I (/pagespeed_static/js_defer.I4cHjq6EEP.js:16:517)
    at G (/pagespeed_static/js_defer.I4cHjq6EEP.js:14:486)
    at HTMLScriptElement.b (/pagespeed_static/js_defer.I4cHjq6EEP.js:22:304)


Without diving into my site's code, does anyone have any idea what might be triggering this error? Or how to get a more detailed error message? I don't know what the node or child is, because the js_defer code has been minified and is impossible to follow. Any thoughts on how I can get more info on what it's trying to remove?

If I am using mod_pagespeed, should I remove all defer from script tags?

These are the filters I have enabled:

ModPagespeedEnableFilters prioritize_critical_css
ModPagespeedEnableFilters defer_javascript
ModPagespeedEnableFilters sprite_images
ModPagespeedEnableFilters rewrite_images
ModPagespeedEnableFilters recompress_png
ModPagespeedEnableFilters convert_jpeg_to_webp
ModPagespeedEnableFilters collapse_whitespace,remove_comments
ModPagespeedEnableFilters combine_css,combine_javascript



Thanks!

Joshua Marantz

unread,
Feb 12, 2018, 7:24:44 PM2/12/18
to mod-pagespeed-discuss
This is definitely defer_javascript -- I can tell from the stack-trace you pasted.  If you remove that from the config, you should be fine.

Note that defer_javascript is a known risky filter that can break sites depending on how the site JS is structured.

You might want to try enabling rewrite_images, unless that does some specific transformations you don't want.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/4cd9cb5c-42bc-4433-84f9-edc8b6c56698%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Stephen Marek

unread,
Feb 13, 2018, 9:56:11 AM2/13/18
to mod-pagespeed-discuss
Thanks! Yea I figured that's what it is and I turned it off, error is gone. I had read the info on the filter at https://www.modpagespeed.com/doc/filter-js-defer but it really didn't offer much help.

And I am using rewrite images. That one took some extra effort. Docs said if my virtual host is *:80, I'd be fine. Not true. I had to add the ModPagespeedDomain directive for each virtual host.

 
Reply all
Reply to author
Forward
0 new messages