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

Fix getRoute override #1904

Merged
merged 2 commits into from May 8, 2024
Merged

Conversation

jembezmamy
Copy link

This PR aims at resolving #1455 - too much recursion error.

The error is caused by getRoute being overridden multiple times: every time setupRouter is called, we create a new layer of recursion. This happens e.g. when we render a link, which calls urlFor, which calls setupRouter. So while the user clicks around the app, getRoute is overridden again and again, which can lead to too much recursion error at some point.

The proposed resolution is to leverage isSetup to make sure the getRoute is extended only once.

@ef4 ef4 force-pushed the fix-get-route-override branch from b665d51 to 848a57f Compare May 7, 2024 22:30
@ef4 ef4 changed the base branch from main to stable May 7, 2024 22:31
@ef4
Copy link
Contributor

ef4 commented May 7, 2024

Thanks.

I retargeted to stable and slightly adjusted the implementation. Now GitHub isn't running the actions...

@ef4 ef4 mentioned this pull request May 7, 2024
@ef4 ef4 merged commit 97b2afa into embroider-build:stable May 8, 2024
203 checks passed
@github-actions github-actions bot mentioned this pull request May 7, 2024
@ef4 ef4 added the bug Something isn't working label May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants