question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ISG not working properly when page route has spaces and deployed through Vercel

See original GitHub issue

What 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

  1. Deploy https://github.com/thiniulian/nextjs-whitespace-bug to vercel
  2. Access the page <deployment>/page one
  3. Refresh the page a few times
  4. Observe the date not changing after all the refreshes
  5. Go to functions log in vercel dashboard, refresh the deployed page and see the error

image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
illusionconnectcommented, Aug 2, 2021

This is still relevant with the current version 11.0 unfortunately

0reactions
balazsorban44commented, Jan 27, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Incremental Static Regeneration – Vercel Docs
Incremental Static Regeneration (ISR) allows you to create or update content without redeploying your site. ISR has three main benefits for developers: ...
Read more >
Vercel or Cloudflare? : r/nextjs - Reddit
I love cloudflare but their workers/pages are one feature I am not a big fan of…I have had a good experience with Vercel....
Read more >
Next.js Static Regeneration on demand - Stack Overflow
The idea is to regenerate each page just once after each data change. I could enforce ISR pages regeneration simply with fetching the...
Read more >
Blog - Next.js 9.5
js 9.5, featuring: Stable Incremental Static Regeneration: re-build static pages after you've deployed, in milliseconds; Customizable Base Path: ...
Read more >
Ep. #90, Performance First with Ishan Anand of Limelight ...
In episode 90 of JAMstack Radio, Brian Douglas speaks with Ishan Anand ... It's a lot of work to get people to go...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found