diff --git a/src/Components/Endpoints/src/Rendering/EndpointHtmlRenderer.Prerendering.cs b/src/Components/Endpoints/src/Rendering/EndpointHtmlRenderer.Prerendering.cs
index abc9441d54fa..ec8407b17a96 100644
--- a/src/Components/Endpoints/src/Rendering/EndpointHtmlRenderer.Prerendering.cs
+++ b/src/Components/Endpoints/src/Rendering/EndpointHtmlRenderer.Prerendering.cs
@@ -20,7 +20,7 @@ internal partial class EndpointHtmlRenderer
protected override IComponent ResolveComponentForRenderMode([DynamicallyAccessedMembers(Component)] Type componentType, int? parentComponentId, IComponentActivator componentActivator, IComponentRenderMode renderMode)
{
- if (_isHandlingErrors || _isReExecuted)
+ if (_isHandlingErrors)
{
// Ignore the render mode boundary in error scenarios.
return componentActivator.CreateInstance(componentType);
diff --git a/src/Components/test/E2ETest/ServerRenderingTests/InteractivityTest.cs b/src/Components/test/E2ETest/ServerRenderingTests/InteractivityTest.cs
index 3322c184ef7a..48e21f77c73e 100644
--- a/src/Components/test/E2ETest/ServerRenderingTests/InteractivityTest.cs
+++ b/src/Components/test/E2ETest/ServerRenderingTests/InteractivityTest.cs
@@ -1502,17 +1502,22 @@ public void LinkNavigationToNotExistingPathReExecutesTo404(string renderMode)
Assert404ReExecuted();
}
- [Theory]
- // prerendering (SSR) is tested in NoInteractivityTest
- [InlineData("ServerNonPrerendered")]
- [InlineData("WebAssemblyNonPrerendered")]
- public void BrowserNavigationToNotExistingPathReExecutesTo404(string renderMode)
+ [Fact]
+ public void BrowserNavigationToNotExistingPathReExecutesTo404()
{
// non-existing path has to have re-execution middleware set up
// so it has to have "reexecution" prefix. Otherwise middleware mapping
// will not be activated, see configuration in Startup
- Navigate($"{ServerPathBase}/reexecution/not-existing-page?renderMode={renderMode}");
+ Navigate($"{ServerPathBase}/reexecution/not-existing-page");
Assert404ReExecuted();
+ AssertReExecutedPageIsInteractive();
+ }
+
+ private void AssertReExecutedPageIsInteractive()
+ {
+ Browser.Equal("Current count: 0", () => Browser.FindElement(By.CssSelector("[role='status']")).Text);
+ Browser.Click(By.Id("increment-button"));
+ Browser.Equal("Current count: 1", () => Browser.FindElement(By.CssSelector("[role='status']")).Text);
}
private void Assert404ReExecuted() =>
diff --git a/src/Components/test/testassets/TestContentPackage/NotFound/ReexecutedPage.razor b/src/Components/test/testassets/TestContentPackage/NotFound/ReexecutedPage.razor
index 6cf5ec51481a..544de1fc5015 100644
--- a/src/Components/test/testassets/TestContentPackage/NotFound/ReexecutedPage.razor
+++ b/src/Components/test/testassets/TestContentPackage/NotFound/ReexecutedPage.razor
@@ -1,6 +1,20 @@
@page "/not-found-reexecute"
+@rendermode RenderMode.InteractiveServer
This page is shown when UseStatusCodePagesWithReExecute is set and another page sets 404
+ +Current count: @currentCount
+ + + +@code { + private int currentCount = 0; + + private void IncrementCount() + { + currentCount++; + } +} \ No newline at end of file