We're trying to implement basePath in our repo and it works until we want to exclude any paths using rewrites in our config. When using rewrites we find that asPath is shortened by the basePath's length even though we've set basePath to false. It appears that asPath works correctly on server, but not on the client.
Using the following config, visit /diets and see asPath is "ts" instead of the expected "/diets". Tried with both /web/diets and /diets as destination, both produce the same problem.
// next.config.js
basePath: '/web',
rewrites: () => [
{
source: '/diets',
destination: '/diets',
basePath: false,
}]
I expect the asPath to be "/diets"
See this file:
Line 41: packages/next/next-server/lib/router/router.ts <-- method that's slicing asPath
Line 64: packages/next/client/index.js <-- client does not check the config for basePath before slicing asPath

Add any other context about the problem here.
@sallomendo
Thank you for such a fast turnaround 馃槏
Please try out next@^9.5.2-canary.2 with the fix!
I can confirm that the issue has been resolved, thanks!
@Timer thank you! We're anxiously awaiting the official release of 9.5.2 馃槃