we are getting this SEO Engine error on the pages ...
# suitecommerce
m
we are getting this SEO Engine error on the pages that we have a API call, I have debugged this
s
Yeah I've seen this recently on another site
m
Is this
s
There's an open issue for a different SEO page generator bug, but it could be related
m
[ +6 ms ] ERROR >>>> {"readyState":0,"killerId":"ajax_killer_60","status":0,"statusText":"ReferenceError: Can't find variable: URLSearchParams","preventDefault":true}
Captura de pantalla 2024-11-08 a la(s) 15.29.59.png
I have removed the Suitlet patch and is working correctly
🥲
s
And is the main div populated?
m
Yes
Is rendering correctly the SEO Engine when enter to the site without JS
Copy code
function parseQueryString(query) {
    var params = {};
    var pairs = query.split('&');

    for (var i = 0; i < pairs.length; i++) {
        var pair = pairs[i].split('=');
        var key = decodeURIComponent(pair[0]);
        var value = decodeURIComponent(pair[1] || '');

        params[key] = value;
    }

    return params;
}
var xhrFactory = jQuery.ajaxSettings.xhr;
jQuery.ajaxSettings.xhr = function() {
   var xhr = xhrFactory.apply(this, arguments);
   var open = xhr.open;
   xhr.open = function () {
        var url = arguments[1];
        var urlSplit = url.split("?");
        if(urlSplit.length > 1) {
            var params = parseQueryString(url);
            if(params.script && params.deploy) {
                var hashed = getSuitelet(params.script, params.deploy);
                if(hashed) {
                    var hashedUrl = new URL(window.location.origin + hashed);
                    params.forEach(function(value, key) {
                        !hashedUrl.searchParams.has(key) && hashedUrl.searchParams.append(key, value);
                    });
                    arguments[1] = hashedUrl.toString().replace(window.location, "");
                }
            }
        }
        return open.apply(this, arguments);
    }
return xhr;
}
This works correctly, without using the URLSearchParams
c
I'm running into this one too.
s
Our devs have written an updated script and I anticipate that they will be pushing it out soon.
👍🏻 1
👍 1
e
We are getting a different error for a site, on the same portion of code @Martin shared: [ +0 ms ] SyntaxError: Expected an identifier but found '[' instead
for (var [key, value] of params.entries())
{ This specific part is not ECMASCRIPT 5.1 compatible and it is throwing the error from the SEO Engine. @Steve Goldberg do you know if the fix include a patch for this?
s
Yes
It also uses
new URL()
which is not ES5.1 either
So the team have had to go back and iterate the script in more vanilla JS
e
Thanks for you response!
s
I am hoping we can add modern JS support to the page generator next year 🙃
👏 1
🙌 1
Then I will never have to think about ES5.1 again
🙌 1
🎉 1
c
Oh please, please, please let that happen!
s
netsuite santa
Only if you've been good this year
netsuite 3
e
That would be a really good improvement!
s
Yeah it's also really big – ripping out a whole rendering engine, as well as doing a bunch of other improvements that we've been wanting to do
c
Isn't it a fork of phantomjs? I ran into something awhile back that said that...
s
Currently, yes, which is why we need to replace it
Hopefully we should use Chromium instead, but we'll see
m
There is any ETA for the 2024.2.10 update to solve the SEO issue ?
s
It's a U2, so soon
m
Great
Thanks, let me know when you are ready for another bug on the CMS js 🙂
s
I have two days off, so Friday 🙃
You can DM it to me, but you may want to raise a case
m
Sure, i will sent you the issue, we are asking customers to create a case
s
Updated SCEM bundle is due tomorrow.
👏 1
SCEM bundle update should be available. Please ensure you're updated and then reactivate.
m
I'm see an update available, but is still not updated the accounts that i have checked