Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable recursive routes in server-side router #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wakamoleguy
Copy link

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

@Ladonasc
Copy link

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.

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.

2 participants