Skip to content

Commit

Permalink
fix: dont loop through empty modules paths (#1013) fixes #1012
Browse files Browse the repository at this point in the history
  • Loading branch information
lukepolo authored Jan 21, 2022
1 parent 7f0245d commit 86e84df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/commands/script-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ async function getFilenamesByPattern(pattern: string): Promise<string[]> {
// Determine the project root
// https://stackoverflow.com/a/18721515
function getPkgJsonDir(): string {
for (const modPath of module.paths) {
for (const modPath of (module.paths || [])) {
try {
const prospectivePkgJsonDir = path.dirname(modPath);
fs.accessSync(modPath, fs.constants.F_OK);
Expand Down

0 comments on commit 86e84df

Please sign in to comment.