How to setup basePath

I want to setup basePath for my app. I changed next.config, utils/trpc, pages/_app
  ...
  trailingSlash: true,
  basePath: '/test',
  async redirects () {
    return [
      {
        source: '/',
        destination: '/test',
        basePath: false,
        permanent: false,
      }
    ];
  },

  url: `${getBaseUrl()}/test/api/trpc`,

<SessionProvider session={session} basePath={`/test/api/auth`}>
      <Component {...pageProps} />
    </SessionProvider>


App seem to work but the webpack hmr seems to be broken after that. I keep getting hmr connection errors warnings.
Anyone can help me how to fix this ?
Screenshot_2022-10-24_at_13.25.23.png
Screenshot_2022-10-24_at_13.25.30.png
Was this page helpful?