From ae496bc9a2a7a6fcfed55ebbfe706e0a615f7c45 Mon Sep 17 00:00:00 2001 From: Vladik Tarasov Date: Wed, 19 May 2021 23:56:28 +0300 Subject: [PATCH] react-loadable-plugin. Handle undefined opts.caller (#25264) `caller` - in babel is optional field - https://babeljs.io/docs/en/options#caller And it may be not provided by developer in transformFile ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. ## Documentation / Examples - [ ] Make sure the linting passes --- packages/next/build/babel/plugins/react-loadable-plugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/next/build/babel/plugins/react-loadable-plugin.ts b/packages/next/build/babel/plugins/react-loadable-plugin.ts index f6491aac59f3b..705b5ee5a7409 100644 --- a/packages/next/build/babel/plugins/react-loadable-plugin.ts +++ b/packages/next/build/babel/plugins/react-loadable-plugin.ts @@ -151,7 +151,7 @@ export default function ({ t.binaryExpression( '+', t.stringLiteral( - (state.file.opts.caller.pagesDir + (state.file.opts.caller?.pagesDir ? relativePath( state.file.opts.caller.pagesDir, state.file.opts.filename