if i use WordPress, that i get error - wordpress jquery-pjax (jquery.pjax.js:672)

Author: Yuriy-SvetlovCreated Jul 11, 2017Updated Feb 4, 2022

if i use WordPress, that i get error - wordpress jquery-pjax (jquery.pjax.js:672) if i use on yii2 or .html static websites that they working is good

$body = undefined in the code

$body = $(parseHTML(data.match(/<body[^>]*>([\s\S.]*)<\/body>/i)[0]))

jquery-3.2.1.min.js

log errors

Uncaught TypeError: Cannot read property '0' of null
    at extractContainer (jquery.pjax.js:672)
    at r.fn.init.options.success (jquery.pjax.js:262)
    at i (jquery-3.2.1.min.js:2)
    at Object.fireWith [as resolveWith] (jquery-3.2.1.min.js:2)
    at A (jquery-3.2.1.min.js:4)
    at XMLHttpRequest.<anonymous> (jquery-3.2.1.min.js:4)

$(document).pjax('a', '#pjax-container', {fragment: '#pjax-container', container:'#pjax-container', timeout: 30000, push: true});