Unverified Commit d9e01ad2 authored by Alex Kirszenberg's avatar Alex Kirszenberg Committed by GitHub

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

## Bug

Fixes WEB-681
parent ed51bd87
...@@ -82,10 +82,10 @@ export async function makeResolver( ...@@ -82,10 +82,10 @@ export async function makeResolver(
await devServer.matchers.reload() await devServer.matchers.reload()
if (middleware.files?.length) { // @ts-expect-error
// @ts-expect-error devServer.customRoutes = await loadCustomRoutes(nextConfig)
devServer.customRoutes = await loadCustomRoutes(nextConfig)
if (middleware.files?.length) {
const matchers = middleware.matcher const matchers = middleware.matcher
? getMiddlewareMatchers(middleware.matcher, nextConfig) ? getMiddlewareMatchers(middleware.matcher, nextConfig)
: [{ regexp: '.*' }] : [{ regexp: '.*' }]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment