vercel / next.js

The React Framework
https://nextjs.org
MIT License
127.04k stars 27k forks source link

linking to routes ending with .htm and trailingSlash on gives error #40254

Open gijsbotje opened 2 years ago

gijsbotje commented 2 years ago

Verify canary release

Provide environment information

Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 21.6.0: Sat Jun 18 17:07:25 PDT 2022; root:xnu-8020.140.41~1/RELEASE_X86_64 Binaries: Node: 16.16.0 npm: 8.11.0 Yarn: 1.22.17 pnpm: N/A Relevant packages: next: 12.2.2 eslint-config-next: 12.2.2 react: 18.2.0 react-dom: 18.2.0

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

Vercel

Describe the Bug

Our client's site uses the trailing slashes setting. We have certain routes ending on .htm, for example https://www.azalp.nl/algemene-voorwaarden.htm. These routes don't benefit from client side routing as there is a mismatch on the client. It searches for the route /algemene-voorwaarden.htm but it expects /algemene-voorwaarden.htm/. This mismatch triggers a client side error: Failed to lookup route: /algemene-voorwaarden.htm.

Expected Behavior

The .htm routes should be able to be found by the client side routing as they shouldn't be expected to have a trailing slash.

Link to reproduction

https://www.azalp.nl/

To Reproduce

Scroll to the footer and click Algemene voorwaarden, Privacy & cookies, Laagste prijsgarantie or Sitemap in the third menu. The console will now show the mentioned error.

This also occurs when you got to, for example, https://www.azalp.nl/tuinhuisjes/ and click on a product.

gijsbotje commented 2 years ago

Anyone? We want to move our second customer to Next but this is also a problem with their pages