Skip to content

Find Javascript Merge Knockout Error In Extensions Uncaught Error: Cannot find closing comment tag to match: ko template:

Magento 2.4.3
Apache
Nginx
MariaDB

Hello Thanks for taking the time to read this.

We have a dev site we are trying to enable Swissup Pagespeed Extension however it is getting 1 error – the merge javascript fails and different sections of the site is not working

VM26:266 Uncaught Error: Cannot find closing comment tag to match: ko template: { name: templates.loader }

We have approx 40 Third Party Extensions from one Company and it seems there is a minor syntax error somewhere in one of the extension files –

Please can anyone advise what is the best and fastest way to isolate which extension is causing the error – in chrome console it is not showing anything – atleast I can’t see any exact reference to the extension

If we disable all the extension the error does not show – but disabling them one by one is not feasible because alot of dependencies within the extensions which is causing more errors.

full error is

Uncaught Error: Cannot find closing comment tag to match:  ko template: { name: templates.loader } 
at getVirtualChildren (eval at require.load (0e8c8f7bbcafffb3cb467ecd2c1bf316.min.js:178:216), <anonymous>:266:7)
at getMatchingEndComment (eval at require.load (0e8c8f7bbcafffb3cb467ecd2c1bf316.min.js:178:216), <anonymous>:267:85)
at Object.nextSibling (eval at require.load (0e8c8f7bbcafffb3cb467ecd2c1bf316.min.js:178:216), <anonymous>:282:186)
at applyBindingsToDescendantsInternal (eval at require.load (0e8c8f7bbcafffb3cb467ecd2c1bf316.min.js:178:216), <anonymous>:314:353)
at applyBindingsToNodeAndDescendantsInternal (eval at require.load (0e8c8f7bbcafffb3cb467ecd2c1bf316.min.js:178:216), <anonymous>:320:234)
at applyBindingsToDescendantsInternal (eval at require.load (0e8c8f7bbcafffb3cb467ecd2c1bf316.min.js:178:216), <anonymous>:316:90)
at applyBindingsToNodeAndDescendantsInternal (eval at require.load (0e8c8f7bbcafffb3cb467ecd2c1bf316.min.js:178:216), <anonymous>:320:234)
at applyBindingsToDescendantsInternal (eval at require.load (0e8c8f7bbcafffb3cb467ecd2c1bf316.min.js:178:216), <anonymous>:316:90)
at ko.applyBindingsToDescendants (eval at require.load (0e8c8f7bbcafffb3cb467ecd2c1bf316.min.js:178:216), <anonymous>:343:1)
at applyComponents (eval at require.load (0e8c8f7bbcafffb3cb467ecd2c1bf316.min.js:178:216), <anonymous>:3:413)e

If we use another pagespeed extension and use the Merge JS the error is not coming.