next.js icon indicating copy to clipboard operation
next.js copied to clipboard

Next 13 [Fetching non-iso urls]

Open asimMoh opened this issue 3 years ago • 4 comments

Verify canary release

  • [X] I verified that the issue exists in the latest Next.js canary release

Provide environment information

Arch: x64 Version: Windows 10 Pro Binaries: Node: 16.17.0 npm: N/A Yarn: N/A pnpm: N/A Relevant packages: next: 13.0.2-canary.2 eslint-config-next: 13.0.1 react: 18.2.0 react-dom: 18.2.0

What browser are you using? (if relevant)

106.0.5249.119 (Official Build) (64-bit) (cohort: Stable)

How are you deploying your application? (if relevant)

No response

Describe the Bug

I think this error is related to the new Router, when prefetching links with Arabic/Persian. PREFETCH ERROR TypeError: Failed to execute 'fetch' on 'Window': Failed to read the 'headers' property from 'RequestInit': String contains non ISO-8859-1 code point.

Expected Behavior

It should work like in Next 12.

Link to reproduction

https://github.com/asimMoh/non-iso

To Reproduce

add some links with non-iso url

<Link href="/مرحبا">Non ISO</Link> <Link href="ecodeURIComponent('/مرحبا')">Non ISO</Link>

asimMoh avatar Nov 03 '22 08:11 asimMoh

same issue in this repo

https://github.com/Marcus-Rise/knitting-blog/blob/refactor/src/post/components/card/post-card.component.tsx#L27

example /джемпер-вечерние-флоксы

Marcus-Rise avatar Nov 03 '22 10:11 Marcus-Rise

reproduced in this test: https://github.com/vercel/next.js/commit/268c230215c91e8930a233b0b45baebb0342462e

image

Marcus-Rise avatar Nov 08 '22 09:11 Marcus-Rise

think, that problem is hiding here https://github.com/vercel/next.js/blob/canary/packages/next/client/components/app-router.tsx#L68

Marcus-Rise avatar Nov 08 '22 09:11 Marcus-Rise

just coded a recursive function, that escapes router app segment value #42626

Marcus-Rise avatar Nov 08 '22 11:11 Marcus-Rise

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

github-actions[bot] avatar Dec 18 '22 12:12 github-actions[bot]