Skip to content

Commit c4651fe

Browse files
committed
fix middleware
1 parent 3b3b439 commit c4651fe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/adapter/build/middleware.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,13 @@ const writeHandlerFile = async (
188188
cache: undefined,
189189
generator: GENERATOR,
190190
name: DISPLAY_NAME_MIDDLEWARE,
191-
pattern: augmentMatchers(middleware, nextConfig).map((matcher) => matcher.regexp),
191+
pattern: augmentMatchers(middleware, nextConfig).map((matcher) => matcher.sourceRegex),
192192
} satisfies IntegrationsConfig
193193

194194
// Writing the function entry file. It wraps the middleware code with the
195195
// compatibility layer mentioned above.
196196
await writeFile(
197-
join(MIDDLEWARE_FUNCTION_DIR, `middleware.js`),
197+
join(MIDDLEWARE_FUNCTION_DIR, `${MIDDLEWARE_FUNCTION_INTERNAL_NAME}.js`),
198198
/* javascript */ `
199199
import { init as htmlRewriterInit } from './edge-runtime/vendor/deno.land/x/htmlrewriter@v1.0.0/src/index.ts'
200200
import { handleMiddleware } from './edge-runtime/middleware.ts';

0 commit comments

Comments
 (0)