next-translate icon indicating copy to clipboard operation
next-translate copied to clipboard

API dynamic and catch-all routes not working with next.js 11 deployed on Vercel

Open berndartmueller opened this issue 3 years ago โ€ข 1 comments

Using dynamic and/or catch-all API routes (e.g /pages/api/auth/[...auth].ts) leads to a 404 error when deployed on Vercel. Locally it works without any issues.

Next.js version: 11.0.2-canary.20 next-translate version: 1.0.7

Github repo with reproduction: https://github.com/berndartmueller/nextjs-11-dynamic-api-catch-all-custom-page-ext-bug/tree/without-custom-page-extension

Working API route (/pages/api/test.ts): https://nextjs-11-dynamic-api-catch-all-custom-page-ext-bug-cxyg91rgx.vercel.app/api/test

404 API catch-all route (/pages/api/auth/[...auth].ts): https://nextjs-11-dynamic-api-catch-all-custom-page-ext-bug-cxyg91rgx.vercel.app/api/auth/session

404 API dynamic route (/pages/api/dynamic/[test].ts): https://nextjs-11-dynamic-api-catch-all-custom-page-ext-bug-cxyg91rgx.vercel.app/api/dynamic/asdf

berndartmueller avatar Aug 01 '21 10:08 berndartmueller

In theory, these files should be ignored https://github.com/vinissimus/next-translate/blob/016de4bf5c571a1d628a9f7e489ae695df7d43e6/src/plugin/utils.ts#L42-L49 unless now in vercel it starts with something other than /api. It works well without next-translate ๐Ÿคจ?

aralroca avatar Oct 08 '21 11:10 aralroca