- Symptom
- Uncaught TypeError from the inline wp-data-js-after script calling wp.data.useSession replay tools flag a code error on every page view
- Cause
- Delay and defer reorder a core inline script so it runs before the script it depends on.
- Fix
- Dequeue the inline after-script on the front end if nothing there needs it, or exclude the dependency from delay.
- Apply
$strip = function () { wp_scripts()->add_data('wp-data', 'after', []); }; add_action('wp_enqueue_scripts', $strip, 9999); add_action('wp_print_footer_scripts', $strip, 1); then confirm document.getElementById('wp-data-js-after') is null- Affected
- WP Rocket delay JS, August 2026
Last verified 2026-08-17 · Confirmed by 0 builders