Newbie Next dev here. How do I combine these in src/middleware.ts
import createMiddleware from 'next-intl/middleware';
import {routing} from './i18n/routing';
export default createMiddleware(routing);
export const config = {
matcher: ['/', '/(mn|en)/:path*']
};
and
import { clerkMiddleware } from "@clerk/nextjs/server";
export default clerkMiddleware();
export const config = {
matcher: [
// Skip Next.js internals and all static files, unless found in search params
'/((?!_next|[^?]*\\.(?:html?|css|js(?!on)|jpe?g|webp|png|gif|svg|ttf|woff2?|ico|csv|docx?|xlsx?|zip|webmanifest)).*)',
// Always run for API routes
'/(api|trpc)(.*)',
],
};
I found this from next-intl doc /docs/routing/middleware ` import {clerkMiddleware, createRouteMatcher} from '@clerk/nextjs/server'; import createMiddleware from 'next-intl/middleware'; import {routing} from './i18n/routing';
const handleI18nRouting = createMiddleware(routing);
const isProtectedRoute = createRouteMatcher(['/:locale/dashboard(.*)']);
export default clerkMiddleware((auth, req) => { if (isProtectedRoute(req)) auth().protect();
return handleI18nRouting(req); });
export const config = { matcher: ['/', '/(de|en)/:path*'] };` but getting this type issue "Property 'protect' does not exist on type 'Promise'"