aspnet / JavaScriptServices

[Archived] This repository has been archived
Apache License 2.0
3.03k stars 518 forks source link

Disabling client side javascript results in EPIPE broken pipe error #719

Closed cramhead closed 7 years ago

cramhead commented 7 years ago

Title

Disabling client side javascript results in EPIPE broken pipe error

Functional Impact

After disabling the JavaScript in the browser and refreshing the div with the Loading... text is displayed instead of the Home component with NavMenu.

Minimal repro steps

  1. dotnet new react to create a new react application
  2. dotnet restore to restore nuget packages
  3. npm install to install JavaScript dependencies
  4. dotnet run to start the application.
  5. At this point the application is running fine on localhost:5000
  6. Disable JavaScript on MacOS chrome version 56.0.2924.87 (64-bit). Any browser I tried has the same issue
  7. Refresh the page
  8. Window reloads with "Loading..." displayed instead of the expected server side rendered application.

Expected result

After refresh the NavMenu and Home component should display when the route is localhost:5000

Actual result

The loading div shows

Further technical details

dotnet --version 1.0.0-rc4-004771

OS: macOS Sierra Version 10.12.3

SteveSandersonMS commented 7 years ago

The React template doesn't support server-side prerendering. The ReactRedux template does support it.

This is because with React alone (not Redux), you would have to invent your own system of transferring server-side state to the client so the client-side app could continue execution. But it doesn't make sense to invent your own system of doing that, as Redux/Flux/etc are designed for exact that use case and are the standard solutions.

So, change your repro steps to use dotnet new reactredux and things will be better :)

cramhead commented 7 years ago

Thanks Steve. I guess I should have thought on it a bit, and it should have been clear. I'm want to try MobX and mobx-state-tree instead of Redux.

fatihapaydin commented 6 years ago

@cramhead can you share your mobx template if it is ready?

cramhead commented 6 years ago

I would have loved to, but alas I move onto something else entirely. I was planning to circle back on this when I find some time.