Skip to content

[PersistentState] not working when page is re-executed #64386

Closed

Description

@AndreiGorlov

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

[PersistentState] not working if page is re-executed e.g. when showing /not-found

Expected Behavior

No response

Steps To Reproduce

Repro: https://github.com/AndreiGorlov/PersistentStateReExecuteRepro

Reload home/counter/weather: Initial RendererInfo.Name:Static Current RendererInfo.Name:Server - All good

Hit "Not found test" (or try to open non existing page): Initial RendererInfo.Name:Server Current RendererInfo.Name:Server - InitialRenderMode not persist

Exceptions (if any)

No response

.NET Version

10.0.100

Anything else?

No response

Activity

  1. added
    area-blazor
    on Nov 16, 2025
  2. MihuBot commented on Nov 16, 2025

    @MihuBot

    I'm a bot. Here is a possible related and/or duplicate issue (I may be wrong):

  3. Stuart88 commented on Nov 17, 2025

    @Stuart88

    It's probably the same as these

    #64384
    #63996
    #63895

  4. javiercn commented on Nov 17, 2025

    @javiercn
    Member

    @AndreiGorlov thanks for contacting us.

    Does this happen during re-execution when you type a not found page URL from the browser URL?

  5. added
    Needs: Author Feedback
    on Nov 17, 2025
  6. AndreiGorlov commented on Nov 17, 2025

    @AndreiGorlov
    Author

    Does this happen during re-execution when you type a not found page URL from the browser URL?

    When I directly browse /not-found page - everything works fine. If I try to browse something like /asd (non existent page) then state not persisting in re-executed /not-found

  7. added
    Needs: Attention 👋
    and removed
    Needs: Author Feedback
    on Nov 17, 2025
  8. javiercn commented on Nov 17, 2025

    @javiercn
    Member

    @AndreiGorlov thanks for the additional details.

    So just to be double sure, when you type something like /asd which causes re-execution is where persistent component state doesn't seem to work. The navigating directly vs enhanced navigation delta is the thing we want to make sure we understand.

  9. removed
    Needs: Attention 👋
    on Nov 17, 2025
  10. AndreiGorlov commented on Nov 17, 2025

    @AndreiGorlov
    Author

    So just to be double sure, when you type something like /asd which causes re-execution is where persistent component state doesn't seem to work.

    Exactly.

  11. javiercn commented on Nov 17, 2025

    @javiercn
    Member

    @AndreiGorlov thanks for the additional details.

    I suspect this issue is different from the other mentioned issues. We'll have a deeper look and provide an update in the future.

  12. added this to the Backlog milestone on Nov 17, 2025
  13. javiercn commented on Nov 24, 2025

    @javiercn
    Member

    The issue is

    if (!isErrorHandlerOrReExecuted)
    {
    var componentStateHtmlContent = await _renderer.PrerenderPersistedStateAsync(context);
    componentStateHtmlContent.WriteTo(bufferWriter, HtmlEncoder.Default);
    }

    The state should only be skipped for the error handler, not when we are re-executing the page. Errors are always rendered statically, but the not found page can be interactive.

  14. added
    bug
    and removed on Nov 24, 2025
  15. AndreiGorlov commented on Dec 26, 2025

    @AndreiGorlov
    Author

    The state should only be skipped for the error handler, not when we are re-executing the page. Errors are always rendered statically, but the not found page can be interactive.

    Note: this issue also prevents authentication state serialization/deserialization for re-executed page.

    (https://learn.microsoft.com/en-us/aspnet/core/release-notes/aspnetcore-9.0?view=aspnetcore-10.0#simplified-authentication-state-serialization-for-blazor-web-apps)

  16. added theissue type on May 1, 2026
  17. self-assigned this
    on Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-blazorbug

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions