Skip to content

disabling ssr causes error in react router#829

Merged
dustinsoftware merged 5 commits intoreactjs:masterfrom
gunnim:deserialize-null-ssr-disabled
Jun 7, 2019
Merged

disabling ssr causes error in react router#829
dustinsoftware merged 5 commits intoreactjs:masterfrom
gunnim:deserialize-null-ssr-disabled

Conversation

@gunnim
Copy link
Copy Markdown
Contributor

@gunnim gunnim commented Jun 7, 2019

Hi guys, long time no see :)

There seems to be an error from at least 4.1.1 and onward (tried 4.2 and 5) which causes a null exception in
React.Router.ReactRouterComponent.RenderRouterWithContext
line 69:
JsonConvert.DeserializeObject<RoutingContext>(reactRouterFunctions.ReactRouterContext)

This happens since when we disable SSR, ReactRouterFunctions never creates a context object in the js engine.

An extremely low effort quick fix follows, providing a default value for routerContext.

@dustinsoftware
Copy link
Copy Markdown
Member

Thanks, I’ll merge this into the 4.x stable branch and release it there as well.

@dustinsoftware dustinsoftware merged commit 3a8573a into reactjs:master Jun 7, 2019
@dustinsoftware
Copy link
Copy Markdown
Member

This is published in 5.0.0-alpha7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants