isomorphic-tutorial
isomorphic-tutorial copied to clipboard
Disable recursive routes in server-side router
Hi,
I was playing around with this tutorial, and I had trouble getting the posts section to work using the server side rendering. It would crash each time I attempted to load http://localhost:3030/posts/1
. Client-side rendering worked fine.
I tracked the issue down to recursive route handling in Director. It looks like both the /posts
and /posts:id
routes were being applied, causing a mismatch in callback parameters and subsequent crash.
It's hard to say, but this may have been a change on Director's part. According to their README, server-side routing has 'backwards' recursion turned on by default. Looking at the code, however, it is set to 'forward.' And it seems to have been changed in an unrelated commit that didn't update the README.
This pull request just configures the DirectorRouter to disable recursive routes, after which the tutorial works on both client- and server-side loads.
Also, thank you for putting this tutorial together. It has been a huge help in wrapping my head around this architecture. Cheers,
-Will
Hi wakamoleguy,
thanks for your investigation, while I was also playing with this tutorial I've discover the same problem. Good to see exactly where the problem came from.