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

Unhandled runtime error originated from Invalid URL using i18n #23772

Closed
danielsimao opened this issue Apr 7, 2021 · 4 comments · Fixed by #27738
Closed

Unhandled runtime error originated from Invalid URL using i18n #23772

danielsimao opened this issue Apr 7, 2021 · 4 comments · Fixed by #27738
Labels
bug Issue was opened via the bug report template.

Comments

@danielsimao
Copy link

What version of Next.js are you using?

10.1.3

What version of Node.js are you using?

12.16

What browser are you using?

Chrome

What operating system are you using?

macOS

How are you deploying your application?

next start

Describe the Bug

In the root of the application, adding 2 slashes ("//"), generates a unhandled run time error and ends up not rendering the 404 page. This only starts occurring when i18n is added in next.config.js.

https://ngyzq.sse.codesandbox.io// - breaks in base path
https://ngyzq.sse.codesandbox.io/about// - handled correctly with 404 rendered in subpaths

Expected Behavior

Should handle invalid URL with 404 page.

To Reproduce

https://codesandbox.io/s/modern-sea-ngyzq?file=/next.config.js

image

@danielsimao danielsimao added the bug Issue was opened via the bug report template. label Apr 7, 2021
@afonsojramos
Copy link
Contributor

That is indeed weird 🤔

@danielsimao
Copy link
Author

Seems like an easy fix but I'm not familiar with nextjs codebase.

@danielsimao
Copy link
Author

Hey @timneutkens, I don't know if this is urgent or not, but my guess is that it is since it breaks the app.

@danielsimao danielsimao changed the title Unhandled runtime error originated from Invalid URL when using i18n Unhandled runtime error originated from Invalid URL using i18n Jun 2, 2021
danielsimao added a commit to danielsimao/next.js that referenced this issue Jun 3, 2021
@kodiakhq kodiakhq bot closed this as completed in #27738 Aug 3, 2021
kodiakhq bot pushed a commit that referenced this issue Aug 3, 2021
This adds handling for repeated forward/back slashes in Next.js, when these slashes are detected in a request to Next.js we will automatically remove the additional slashes redirecting with a 308 status code which prevents duplicate content when being crawled by search engines. 

Fixes: #13011
Fixes: #23772
Closes: #15171
Closes: #25745
flybayer pushed a commit to blitz-js/next.js that referenced this issue Aug 19, 2021
This adds handling for repeated forward/back slashes in Next.js, when these slashes are detected in a request to Next.js we will automatically remove the additional slashes redirecting with a 308 status code which prevents duplicate content when being crawled by search engines. 

Fixes: vercel#13011
Fixes: vercel#23772
Closes: vercel#15171
Closes: vercel#25745
@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 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants