diff --git a/packages/react-scripts/config/paths.js b/packages/react-scripts/config/paths.js index abd2db3be7d..5d8c7aaa51e 100644 --- a/packages/react-scripts/config/paths.js +++ b/packages/react-scripts/config/paths.js @@ -140,6 +140,9 @@ const getMonorepoPkgPaths = () => { if (monoPkgPath) { // get monorepo config from yarn workspace const pkgPatterns = require(monoPkgPath).workspaces; + if (pkgPatterns == null) { + return []; + } const pkgPaths = findPkgs(path.dirname(monoPkgPath), pkgPatterns); // only include monorepo pkgs if app itself is included in monorepo if (pkgPaths.indexOf(appDirectory) !== -1) {