Koa server example not working for more complex use case with react, redux, apollo
I have been working on porting this example example_01_nextjs_apollo to a Koa server instead of Express. If you build the routes just like in next custom-server-koa then it will fail. It seems like the linked pages are loading too quickly & not awaiting rendering. The pages show either TypeError: Cannot read property 'map' of undefined or an unexpected error has occured. However, if you wait a few seconds and refresh the page the page renders properly. In console, after a few seconds I see [HMR] Updated modules: ... & then it works if refreshed.
I acknowledge I might be doing something wrong with koa-router, but if that's the case the custom-server-koa example should be updated.
For now I will use express
The problem is not with Koa itself. The example you're trying it on is simply written in a bit of a hurry and outdated as of now. I've created a PR for it that just needs a little more work to be fully fixing all the issues.