Skip to content

Commit 808f18c

Browse files
authored
Fix firefox bug with detecting instanceof Promise in dynamic (#7203)
1 parent e3f0236 commit 808f18c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/next-server/lib/dynamic.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ export default function dynamic<P = {}>(
109109
const loadModules: LoaderMap = {}
110110
const modules = dynamicOptions.modules()
111111
Object.keys(modules).forEach((key) => {
112-
const value = modules[key]
113-
if (value instanceof Promise) {
112+
const value: any = modules[key]
113+
if (typeof value.then === 'function') {
114114
loadModules[key] = () => value.then((mod: any) => mod.default || mod)
115115
return
116116
}

0 commit comments

Comments
 (0)