Skip to content

Commit

Permalink
react-loadable-plugin. Handle undefined opts.caller (#25264)
Browse files Browse the repository at this point in the history
`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
  • Loading branch information
SinimaWath authored May 19, 2021
1 parent c0a07aa commit 935a66d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/next/build/babel/plugins/react-loadable-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 935a66d

Please sign in to comment.