dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.37k stars 9.99k forks source link

Blazor full-stack: server-only pages prerender before they 404, creating a jarring FOUC #51847

Open gulbanana opened 11 months ago

gulbanana commented 11 months ago

Is there an existing issue for this?

Describe the bug

Visiting the /Error page from a link displays the page for a second while prerending and then falls back to a Not Found. Here's a demo:

https://github.com/dotnet/aspnetcore/assets/1612285/415d49fc-bc6a-4994-8780-cbf24359e58f

Expected Behavior

The page should be built in a way that will work on both client and server.

Steps To Reproduce

  1. Create a new Blazor Web App project with interactivity type Auto and interactivity location Global.
  2. If using RC2 instead of RTM, move the Error page from client to server as described here https://github.com/dotnet/aspnetcore/issues/51352#issuecomment-1761640921
  3. Add an <a href="/Error"> to the home page.
  4. Run the app and click on the link.

Exceptions (if any)

No response

.NET Version

8.0.100-rc.2.23502.2

Anything else?

No response

javiercn commented 11 months ago

@gulbanana thanks for contacting us.

The error page is only meant to be there for handling error scenarios in SSR. We don't expect it to be used as a page that gets linked to from other locations in the app.

The behavior is a bit odd, but it's the best we can do today, since the page lives on the server but doesn't live on the client.

If in .NET 9.0 we pursue a unified project experience; this problem will logically go away.

ghost commented 9 months ago

Thanks for contacting us.

We're moving this issue to the .NET 9 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s). If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.