Next api routes stoped working since clerk installed

I installed clerk in my app and auth is working as expected. My probles is that all my api routes stoped working, all of them throw error 404.
3 Replies
JuaniS
JuaniSOP2y ago
This is my middleware
import { authMiddleware } from '@clerk/nextjs';

import createMiddleware from 'next-intl/middleware';

const intlMiddleware = createMiddleware({
locales: ['en', 'el'],

defaultLocale: 'en'
});

export default authMiddleware({
beforeAuth: (req) => {
return intlMiddleware(req);
},

publicRoutes: ['/', '/:locale/sign-in']
});

export const config = {
matcher: ['/((?!.*\\..*|_next).*)', '/', '/(api|trpc)(.*)']
};
import { authMiddleware } from '@clerk/nextjs';

import createMiddleware from 'next-intl/middleware';

const intlMiddleware = createMiddleware({
locales: ['en', 'el'],

defaultLocale: 'en'
});

export default authMiddleware({
beforeAuth: (req) => {
return intlMiddleware(req);
},

publicRoutes: ['/', '/:locale/sign-in']
});

export const config = {
matcher: ['/((?!.*\\..*|_next).*)', '/', '/(api|trpc)(.*)']
};
its the same that in the docs im using clerk/next version 4.21.12 and next js with app directory
JuaniS
JuaniSOP2y ago
example of error i get in console
JuaniS
JuaniSOP2y ago
my app folder
Want results from more Discord servers?
Add your server