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

When href interpolation fails we should error properly #16944

Closed
ijjk opened this issue Sep 8, 2020 · 1 comment · Fixed by #16946
Closed

When href interpolation fails we should error properly #16944

ijjk opened this issue Sep 8, 2020 · 1 comment · Fixed by #16946
Assignees
Milestone

Comments

@ijjk
Copy link
Member

ijjk commented Sep 8, 2020

Another thing I noticed: when I provide fewer params than necessary, the url resolves to the index page without warning, e.g. {pathname: „/[locale]/blog/[id]“, query: {id: 1}} (locale missing) becomes /?id=1. Maybe in this case a warning should be logged or an even error thrown?

Originally posted by @herrstucki in #16851 (comment)


If interpolation fails we need to throw an error instead of returning an invalid URL since this can result in unexpected behavior.

@ijjk ijjk self-assigned this Sep 8, 2020
@kodiakhq kodiakhq bot closed this as completed in #16946 Sep 10, 2020
kodiakhq bot pushed a commit that referenced this issue Sep 10, 2020
This adds an error when interpolation fails to make sure invalid `href`s aren't accidentally used and an invalid URL is built. 

Closes: #16944
@Timer Timer added this to the iteration 9 milestone Sep 10, 2020
HitoriSensei pushed a commit to HitoriSensei/next.js that referenced this issue Sep 26, 2020
This adds an error when interpolation fails to make sure invalid `href`s aren't accidentally used and an invalid URL is built. 

Closes: vercel#16944
@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants