Skip to content

context issues when rendering on server after upgrading to 0.13 #1093

@balanceiskey

Description

@balanceiskey

Hi there,

I'm getting the following error when attempting to render on the server:

Warning: Failed Context Types: Required context routerwas not specified inMobileApp.

As far as I can tell there's nothing terribly special about my rendering approach and the render works just fine on the client-side. Here's what the server-side code looks like:

 Router.run(mobileRoutes, request.url.path, function (Handler) {
    const html = React.renderToString(<Handler initialStories={initialStories} />);

    //... we never make it down here it seems
});

Note, the server-side file is transpiled with Babel, hence the ability to use JSX like this, but am I missing something else? MobileApp in this case does also have contextTypes defined.

The eventual error that's thrown is this which I imagine is related to the router context stuff:
[TypeError: Cannot read property 'getRouteAtDepth' of undefined]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions