ISG not working properly when page route has spaces and deployed through Vercel
See original GitHub issueWhat version of Next.js are you using?
10.0.4
What version of Node.js are you using?
14.3.0
What browser are you using?
not relevant
What operating system are you using?
vercel’s os
How are you deploying your application?
vercel
Describe the Bug
The incremental static generation is not working if the page route has white spaces in the name, like /news/head to head
.
Looking in vercel function logs we can see that the revalidation request fails with the error.
ERROR Invoke Error {"errorType":"TypeError","errorMessage":"Request path contains unescaped characters","code":"ERR_UNESCAPED_CHARACTERS","stack":["TypeError [ERR_UNESCAPED_CHARACTERS]: Request path contains unescaped characters"," at new ClientRequest (_http_client.js:148:13)"," at Object.request (http.js:46:10)"," at /var/task/now__bridge.js:125:32"," at new Promise (<anonymous>)"," at Bridge.launcher (/var/task/now__bridge.js:123:16)"]}
The funny thing is that at build time works just fine and loading the page afterwards works fine as well, but remains stale.
The actual error is coming from the request
function from the http
module which is used in the vercel node_bridge, but the actual request seems to start from next.js.
Expected Behavior
Revalidation should work as the build time process and revalidate the page.
To Reproduce
- Deploy https://github.com/thiniulian/nextjs-whitespace-bug to vercel
- Access the page
<deployment>/page one
- Refresh the page a few times
- Observe the date not changing after all the refreshes
- Go to functions log in vercel dashboard, refresh the deployed page and see the error
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:5 (3 by maintainers)
This is still relevant with the current version 11.0 unfortunately
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.