Repository navigation
Description
Description
Since #71123, the Interactivity API runtime calls onDOMReady( hydrateRegions ) while @wordpress/interactivity is being evaluated (index.ts#L114). onDOMReady() reads the first navigation timing entry without checking that one exists (utils.ts#L90-L100):
const [ navigation ] = performance.getEntriesByType( 'navigation' );
if ( ( navigation as PerformanceNavigationTiming ).domContentLoadedEventStart > 0 ) {When performance.getEntriesByType( 'navigation' ) returns an empty list, this throws TypeError: Cannot read properties of undefined (reading 'domContentLoadedEventStart'). The rest of the module doesn't run, so no region is hydrated, and the modules that import it (e.g. @wordpress/block-library/navigation/view) fail too: interactive blocks stop working on the page (the Navigation block's overlay menu doesn't open).
We found it through error monitoring (Sentry) on a production site. Every event came from the headless browser Lightpanda (Lightpanda/1.0, used by AI agents and crawlers), which has no navigation timing entry. Regular browsers don't seem to be affected, but jsdom has the same gap: the router's test setup mocks getEntriesByType for this reason (jsdom-setup.ts#L6-L9).
Expected: the runtime doesn't throw when the entry is missing. For example, it could fall back to document.readyState: run the callback when it is complete, otherwise wait for DOMContentLoaded, with load as a backstop for interactive (where it can't tell whether DOMContentLoaded has already fired).
Step-by-step reproduction instructions
- Use WordPress 7.1.4 with Twenty Twenty-Five and no plugins. Its header has a Navigation block with the overlay menu, so
@wordpress/interactivityloads on the front end. - Make
performance.getEntriesByType()return an empty list before the script modules run, for example with this mu-plugin (or open the page in Lightpanda):<?php add_action( 'wp_head', function () { echo '<script>performance.getEntriesByType = function () { return []; };</script>'; }, -1000 );
- Open the front page and check the console.
Uncaught TypeError: Cannot read properties of undefined (reading 'domContentLoadedEventStart')is logged frominteractivity/index.min.js,history.statehas nowpInteractivityId, and clicking the Navigation block's menu button does nothing.
Without step 2 there is no error and the menu opens.
Screenshots, screen recording, code snippet
Uncaught TypeError: Cannot read properties of undefined (reading 'domContentLoadedEventStart')
at Tr (/wp-includes/js/dist/script-modules/interactivity/index.min.js?ver=6a43cba92ed701f32cd9:1:21246)
at /wp-includes/js/dist/script-modules/interactivity/index.min.js?ver=6a43cba92ed701f32cd9:1:42327
Environment info
- WordPress 7.1.4. The Gutenberg plugin isn't installed, but
onDOMReady()is unchanged in trunk (503ab9f). - Twenty Twenty-Five 1.5, no plugins
- Reproduced in Chromium with the snippet above; seen in production with
Lightpanda/1.0
Please confirm that you have searched existing issues in the repo.
- Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
- Yes
Please confirm which theme type you used for testing.
- Block
- Classic
- Hybrid (e.g. classic with theme.json)
- Not sure
Activity
luisherranz commentedon Nov 11, 2026
I looked into which environments can hit this, and I'm closing it as not planned:
onDOMReady()always finds it in a browser that can run the runtime.