yurii
yurii

Reputation: 11

Next js interception routes with dynamic parameters don't work on vercel production mode

This may be a duplicate of Next.js intercepting routes feature doesn't work in production mode. I'm facing the same problem, locally everything works as expected in dev and prod mode, but when I try to navigate to the same route on vercel, it returns a 500 error and shows this in the logs:

Error: Invalid interception route: /collections//(.). Must be in the format /<interception route>/(..|...|..)(..)/<interception route>.

I suspect that the problems may be that next doesn't replace the dynamic parameter here for actual value, but it shows up correctly in the pathname on vercel request info.

Here is my next.config file:

/** @type {import('next').NextConfig} */
const nextConfig = {
  trailingSlash: true,
};

export default nextConfig;

I've tried to change the path from (.) to (..), but in that case as expected it returns 404. Also the same error even if I hard code the links with valid values

Upvotes: 1

Views: 97

Answers (0)

Related Questions