Fix the Next.js router in Turbopack when there are no middlewares (#46681)

## Bug

Fixes WEB-681
This commit is contained in:
Alex Kirszenberg 2023-03-02 16:14:37 +01:00 committed by GitHub
parent ed51bd870b
commit d9e01ad224
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -82,10 +82,10 @@ export async function makeResolver(
await devServer.matchers.reload()
if (middleware.files?.length) {
// @ts-expect-error
devServer.customRoutes = await loadCustomRoutes(nextConfig)
// @ts-expect-error
devServer.customRoutes = await loadCustomRoutes(nextConfig)
if (middleware.files?.length) {
const matchers = middleware.matcher
? getMiddlewareMatchers(middleware.matcher, nextConfig)
: [{ regexp: '.*' }]