Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

demo/interactivity router broken #8

Draft
wants to merge 1 commit into
base: trunk
Choose a base branch
from

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