Skip to content

Conversation

sirreal
Copy link
Owner

@sirreal sirreal commented Sep 24, 2024

This demonstrates an error where client side navigation causes an error in the interactivity-router package if server side state defining store.state.navigation as an object is removed.

Errors:

Uncaught (in promise) TypeError: Cannot set properties of undefined (setting 'hasStarted')

On this line:

// Don't update the navigation status immediately, wait 400 ms.
const loadingTimeout = setTimeout( () => {
if ( navigatingTo !== href ) {
	return;
}

if ( loadingAnimation ) {
	navigation.hasStarted = true; // <---- 💥💥💥 error
	navigation.hasFinished = false;
}
if ( screenReaderAnnouncement ) {
	a11ySpeak( 'loading' );
}
}, 400 );

Trac ticket:


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@sirreal sirreal force-pushed the demo/interactivity-router-broken branch from a6595cc to 20f614e Compare September 24, 2024 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant