Skip to content

Commit

Permalink
Fix esm module import warning for middleware loader
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Jun 9, 2023
1 parent e5b88ca commit 6c8a790
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ export default function middlewareLoader(this: any) {
return `
import 'next/dist/esm/server/web/globals'
import { adapter } from 'next/dist/esm/server/web/adapter'
import * as mod from ${stringifiedPagePath}
import * as _mod from ${stringifiedPagePath}
const mod = { ..._mod }
const handler = mod.middleware || mod.default
if (typeof handler !== 'function') {
Expand Down

0 comments on commit 6c8a790

Please sign in to comment.