Skip to content

Commit 2a60b09

Browse files
Fix "Missing dependencies in package.json" (require(appPkg) caching contents before deps added)
1 parent d1d4546 commit 2a60b09

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/react-dev-utils/workspaceUtils.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ const findPkgs = (rootPath, globPatterns) => {
3030
};
3131

3232
const findMonorepo = appDir => {
33-
const appPkg = require(path.resolve(appDir, 'package.json'));
33+
const appPkg = JSON.parse(
34+
fs.readFileSync(path.resolve(appDir, 'package.json'))
35+
);
3436
const monoPkgPath = findPkg.sync(path.resolve(appDir, '..'));
3537
const monoPkg = monoPkgPath && require(monoPkgPath);
3638
const workspaces = monoPkg && monoPkg.workspaces;

0 commit comments

Comments
 (0)