vercel / next.js

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

revalidatePath with nextConfig.trailingSlash [true], not working correctly on Vercel deployment #59836

Open LordLafayette opened 11 months ago

LordLafayette commented 11 months ago

Link to the code that reproduces this issue

https://github.com/LordLafayette/next-revalidate

To Reproduce

  1. yarn build > yarn start
  2. Go to "/form"
  3. Check the checkbox if you want revalidatePath function to revalidate path with trailingSlash end or not
  4. Click "submit" button
  5. Go to "/time" to check the result

you can try this link > https://next-revalidate-nine.vercel.app/time/

Current vs. Expected behavior

Current

nextConfig.trailingSlash : true

Expected

nextConfig.trailingSlash : true

Verify canary release

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Home Single Language
Binaries:
  Node: 20.10.0
  npm: N/A
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 14.0.4
  eslint-config-next: 14.0.4
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.3.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Not sure

Additional context

On Local server

with yarn build & build start , i have setting nextConfig.trailingSlash = true then i want to revalidate static render with revalidatePath with trailingSlash at end , ex : revalidatePath('/time/') the app working fine with revalidate Full Route cache or ISR

On Vercel

run at same code at local server, but when revalidatePath with trailing Slash at end, ex : revalidatePath('/time/') it not working. but if i try revalidatePath('/time') (with no trailing Slash at end) it work correctly.

you can try this link > https://next-revalidate-nine.vercel.app/time/

LordLafayette commented 11 months ago

USE CASE

Local server (yarn build & yarn start) nextConfig.trailingSlash = true

Vercel server nextConfig.trailingSlash = true

ats1999 commented 10 months ago

Facing the same issue

humet commented 5 months ago

This still happens on Vercel deploys. As @LordLafayette mentioned, it doesn't happen locally.

Edit by maintainer bot: Comment was automatically minimized because it was considered unhelpful. (If you think this was by mistake, let us know). Please only comment if it adds context to the issue. If you want to express that you have the same problem, use the upvote 👍 on the issue description or subscribe to the issue for updates. Thanks!

rhayes2 commented 2 weeks ago

Im seeing a similar issue