How to solve this error "Headers are read-only, response has already started" #4416
-
I used some of the code on blazor in the csla 8.2.8 source code sample to create my own blazor server program. In this program I just add a page editperson, and when it runs it always says "Headers are read-only, response has already started".I find that errors always appear when I use vm.RefreshAsync. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 25 replies
-
Please show the edit person create method. It looks like there is an await missing on the server side part. |
Beta Was this translation helpful? Give feedback.
-
This is almost certainly a configuration issue in |
Beta Was this translation helpful? Give feedback.
-
I tried to upgrade from 8.2.7 to 8.2.8 today and immediately got the I'm using the <head>
...
<HeadOutlet @rendermode = "RenderModeForPage" />
</head>
IComponentRenderMode RenderModeForPage => HttpContext.Request.Path.StartsWithSegments("/identity")
? null
: InteractiveServer;
builder.Services.AddCsla(o => o.AddAspNetCore()
.AddServerSideBlazor(o => o.UseInMemoryApplicationContextManager = false)
.DataPortal (d => d.AddServerSideDataPortal())); |
Beta Was this translation helpful? Give feedback.
-
I upgraded to 8.28 too and had the same issue. I then changed one line and now it works.
builder.Services.AddCsla(o => o
.AddAspNetCore()
.AddServerSideBlazor());
My application is a blazor server application with an interactive landing page too. I did not add or subtract any other line.
Have a nice day.
Kevin
…________________________________
From: Stefan Ossendorf ***@***.***>
Sent: Wednesday, February 5, 2025 3:13 AM
To: MarimerLLC/csla ***@***.***>
Cc: Subscribed ***@***.***>
Subject: Re: [MarimerLLC/csla] How to solve this error "Headers are read-only, response has already started" (Discussion #4416)
I would say one PR with a context manager involved 😅
https://github.com/MarimerLLC/csla/releases/tag/v8.2.8
—
Reply to this email directly, view it on GitHub<#4416 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AGJTVDXKTL6ZXEPHC64SS732OHI3JAVCNFSM6AAAAABUG3WCV6VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTEMBWGY2DAOA>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
The fix is now in the v8.x branch and soon main (for v9).
Please note that the landing page does not need to be server-static - a server-interactive page is fine, as long as the state manager gets initialized in the page's
OnInitializeAsync
method.