diff --git a/packages/next/build/babel/plugins/react-loadable-plugin.ts b/packages/next/build/babel/plugins/react-loadable-plugin.ts index f6491aac59f3b1..0362243409a971 100644 --- a/packages/next/build/babel/plugins/react-loadable-plugin.ts +++ b/packages/next/build/babel/plugins/react-loadable-plugin.ts @@ -145,13 +145,14 @@ export default function ({ Import(importPath) { const importArguments = importPath.parentPath.get('arguments') if (!Array.isArray(importArguments)) return + const node: any = importArguments[0].node dynamicImports.push(node) dynamicKeys.push( t.binaryExpression( '+', t.stringLiteral( - (state.file.opts.caller.pagesDir + (state.file.opts.caller?.pagesDir ? relativePath( state.file.opts.caller.pagesDir, state.file.opts.filename