-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix: buildLocation check for non changing routes - consider trailing slashes #4581
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
Conversation
View your CI Pipeline Execution ↗ for commit 952f5e8
☁️ Nx Cloud last updated this comment at |
More templates
@tanstack/arktype-adapter
@tanstack/directive-functions-plugin
@tanstack/eslint-plugin-router
@tanstack/history
@tanstack/react-router
@tanstack/react-router-devtools
@tanstack/react-router-with-query
@tanstack/react-start
@tanstack/react-start-client
@tanstack/react-start-plugin
@tanstack/react-start-server
@tanstack/router-cli
@tanstack/router-core
@tanstack/router-devtools
@tanstack/router-devtools-core
@tanstack/router-generator
@tanstack/router-plugin
@tanstack/router-utils
@tanstack/router-vite-plugin
@tanstack/server-functions-plugin
@tanstack/solid-router
@tanstack/solid-router-devtools
@tanstack/solid-start
@tanstack/solid-start-client
@tanstack/solid-start-plugin
@tanstack/solid-start-server
@tanstack/start-client-core
@tanstack/start-plugin-core
@tanstack/start-server-core
@tanstack/start-server-functions-client
@tanstack/start-server-functions-fetcher
@tanstack/start-server-functions-server
@tanstack/valibot-adapter
@tanstack/virtual-file-routes
@tanstack/zod-adapter
commit: |
ran all tests locally multiple times, by resetting the local nx cache and workspaceData, and I'm not able to reproduce the failure reported here. |
that's a flaky test in ci |
when running the test in isolation I was able to get the error. I added a check for the "Client only Content" before navigation to ensure it has rendered prior to navigation. This seems to have resolved the error. Also updated it to find by testId and added mock for scrollTo. Hoping this resolves the issue in the CI |
very cool. coming back to the original issue, can we not build a unit test that resembles the reproducer? |
I'll spend some time to try and recreate it now. Going to be a bit trial and error since I'm not too sure what navigation action caused a trailing slash on the fromPath that broke it. But once I have figured that out, I can add the test |
test added. ended up just being the route path that had to be set accordingly |
It works with the latest release 🥳 Thanks @nlynzaad & @schiller-manuel |
This PR is a follow-up to #4573.
When checking if the paths have changed, we need to also take into account any trailing slashes. This resolves #4580.
when comparing the paths in this issue the resolved path for dest.to did not have a trailing slash while the fromPath did.
Setting up test for similar routing structures did not lead to the same failures so I'm not too sure how to recreate this with a test, to be honest not sure what would be the required actions to cause the from path to contain a trailing slash.
Tested this by patching the modules in the example and it succeeded then.