File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -78,11 +78,14 @@ exports.removeGlobalNodeModuleLookupPaths = function () {
78
78
// @ts -ignore
79
79
Module . _resolveLookupPaths = function ( moduleName , parent ) {
80
80
const paths = originalResolveLookupPaths ( moduleName , parent ) ;
81
- let commonSuffixLength = 0 ;
82
- while ( commonSuffixLength < paths . length && paths [ paths . length - 1 - commonSuffixLength ] === globalPaths [ globalPaths . length - 1 - commonSuffixLength ] ) {
83
- commonSuffixLength ++ ;
81
+ if ( Array . isArray ( paths ) ) {
82
+ let commonSuffixLength = 0 ;
83
+ while ( commonSuffixLength < paths . length && paths [ paths . length - 1 - commonSuffixLength ] === globalPaths [ globalPaths . length - 1 - commonSuffixLength ] ) {
84
+ commonSuffixLength ++ ;
85
+ }
86
+ return paths . slice ( 0 , paths . length - commonSuffixLength ) ;
84
87
}
85
- return paths . slice ( 0 , paths . length - commonSuffixLength ) ;
88
+ return paths ;
86
89
} ;
87
90
} ;
88
91
You can’t perform that action at this time.
0 commit comments