Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

Error: "Cannot read property 'has' of undefined" after glob update v7.2.0 to v7.2.2 #253

Open
CHENJIAMIAN opened this issue May 14, 2022 · 0 comments

Comments

@CHENJIAMIAN
Copy link

CHENJIAMIAN commented May 14, 2022

Error at  //if (!module.get(base).has(lower))
resolvePath (D:\Desktop\xxxx\node_modules\_babel-plugin-lodash@3.3.4@babel-plugin-lodash\lib\importModule.js:22:24)

That is Why

After dependency glob update v7.2.0 to v7.2.2, the common.js of glob added 'options.allowWindowsEscape = true',

//node_modules/_babel-plugin-lodash@3.3.4@babel-plugin-lodash/lib/ModuleCache.js

//var dirPaths = (0, _orderBy2.default)(_glob.default.sync(_path.default.join(moduleRoot, '**/'), {
//      'ignore': _path.default.join(moduleRoot, 'node_modules/**/')
//    }), function (dirPath) {
//      return (0, _startsWith2.default)(dirPath, mainPath);
//    }, ['desc']);

//in my case:
glob.sync('D:/Desktop/xxxx/node_modules/_lodash@4.17.21@lodash/**/', {
    'ignore': 'D:/Desktop/xxxx/node_modules/_lodash@4.17.21@lodash/node_modules/**/'
})

//node_modules/_glob@7.2.0@glob/common.js
self.minimatch=new Minimatch(pattern, options) //self.minimatch=(7)['D:', 'Desktop', 'xxxx', 'node_modules', '_lodash@4.17.21@lodash', {…}, '']
    //options:{ignore: 'D:\\Desktop\\xxxx\\node_modules\\_lodash@4.17.21@lodash\\node_modules\\**\\', nonegate: true, nocomment: true}
    //pattern:'D:\\Desktop\\xxxx\\node_modules\\_lodash@4.17.21@lodash\\**\\'

//node_modules/_glob@7.2.2@glob/common.js
self.minimatch=new Minimatch(pattern, options) // self.minimatch=(1)[/^(?=.)D:Desktopxxxxnode_modules_lodash\\@4\\.17\\.21\\@lodash\\*[^/]*?\\\\$/]
    //options:{ignore: 'D:\\Desktop\\xxxx\\nod…ules\\_lodash@4.17.21@lodash\\node_modules\\**\\', nonegate: true, nocomment: true, allowWindowsEscape: true}
    //pattern:'D:\\Desktop\\xxxx\\node_modules\\_lodash@4.17.21@lodash\\**\\'
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant