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 dynamic routes for sites with subpath #2299

Merged
merged 1 commit into from
Jan 4, 2022

Conversation

tadeuzagallo
Copy link
Contributor

Changes

The route being passed into ssrOptions included the configured site pathname and therefore failed to match any patterns in the available routes when trying to extract parameters. This made it so that every valid dynamic route would error with route pattern matched, but no matching static path found.

Testing

I added tests for all the scenarios currently being tested under Dynamic Routing for both valid and invalid dynamic routes.

Docs

No documentation changes should be required since it's only a bug fix.

@changeset-bot
Copy link

changeset-bot bot commented Jan 1, 2022

🦋 Changeset detected

Latest commit: 9e8444b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
astro Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added pkg: astro Related to the core `astro` package (scope) test labels Jan 1, 2022
@netlify
Copy link

netlify bot commented Jan 1, 2022

✔️ Deploy Preview for astro-www ready!

🔨 Explore the source changes: ebf3026

🔍 Inspect the deploy log: https://app.netlify.com/sites/astro-www/deploys/61d0c06359b8ce0007006d28

😎 Browse the preview: https://deploy-preview-2299--astro-www.netlify.app

@netlify
Copy link

netlify bot commented Jan 1, 2022

✔️ Deploy Preview for astro-docs-2 ready!

🔨 Explore the source changes: ebf3026

🔍 Inspect the deploy log: https://app.netlify.com/sites/astro-docs-2/deploys/61d0c063ccae050008ed86fb

😎 Browse the preview: https://deploy-preview-2299--astro-docs-2.netlify.app

Copy link
Member

@FredKSchott FredKSchott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great find, thanks for the fix! LGTM but will let another maintainer review/merge

@matthewp
Copy link
Contributor

matthewp commented Jan 4, 2022

This looks great, @tadeuzagallo can you run yarn changeset and make this be a patch? Then push the file created.

@tadeuzagallo
Copy link
Contributor Author

Done @matthewp. I amended the last commit, hopefully that's ok.

@matthewp matthewp merged commit 5fbdd56 into withastro:main Jan 4, 2022
@tadeuzagallo tadeuzagallo deleted the dev-dynamic-routes branch January 4, 2022 18:22
@github-actions github-actions bot mentioned this pull request Jan 4, 2022
@FredKSchott FredKSchott self-assigned this Jan 5, 2022
SiriousHunter pushed a commit to SiriousHunter/astro that referenced this pull request Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants