Next.js Discord

Discord Forum

Help basePath not working

Unanswered
West African Crocodile posted this in #help-forum
Open in Discord
West African CrocodileOP
I need your help with Next 13

my app is working great with localhost:4000
but i need to move my app to localhost:4000/client with everything, middleware, links, images

I have done a few things according to documentation

next.config.js
----
require('dotenv').config();

/ @type {import('next').NextConfig} */
const nextConfig = {
basePath: '/client',
}

module.exports = nextConfig

middleware.ts
-----

import createIntlMiddleware from 'next-intl/middleware';
import { NextRequest, NextResponse } from 'next/server';

//Middleware (in attachement)

The problem is that ... it does not work
When i hit localhost:4000/client/login or client/ or client/recorder it is always brings 404**

My app structure is the same
/app
/[locale]
/login
page.tsx
/recorder
page.tsx
/api
/init
route.ts


What can cause the problem and how to solve it?

0 Replies