You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeError: patterns.reduce is not a function
at Object.expandPatternsWithBraceExpansion (E:\material-ui\node_modules\fast-glob\out\utils\pattern.js:131:21)
at processPatterns (E:\material-ui\node_modules\fast-glob\out\managers\tasks.js:27:34)
at Object.generate (E:\material-ui\node_modules\fast-glob\out\managers\tasks.js:7:20)
at getWorks (E:\material-ui\node_modules\fast-glob\out\index.js:91:31)
at FastGlob (E:\material-ui\node_modules\fast-glob\out\index.js:10:19)
at main (file:///E:/material-ui/scripts/testBuiltTypes.mjs:9:34)
at file:///E:/material-ui/scripts/testBuiltTypes.mjs:36:1
at ModuleJob.run (node:internal/modules/esm/module_job:194:25)
Expected behavior
No errors.
Steps to reproduce
We have a script to check if there is any defect in the generated TypeScript .d.ts build files. We use fast-glob to traverse these build files. You can see the error in mui/material-ui#37789.
There is an error in the latest version 3.3.0 which you can see in this GitHub pull request: mui/material-ui#37789.
After some debugging and going through the stack trace, it appears that the error is caused by this line of code in the processPatterns function. The processPatterns function expects a pattern as its first argument (but here it is settings.ignore), and the error pattern.reduce() is not a function occurs in the Object.expandPatternsWithBraceExpansion function. The braceExpansion option is set to true by default, triggering the expandPatternsWithBraceExpansion function. But
The text was updated successfully, but these errors were encountered:
Sorry it's an update from my side. settings.ignore expects an array. So changed from ignore: 'node_modules' to ignore: ['node_modules']. Our syntax was wrong since long for settings.ignore. The error started to show up since the latest release because of its usage in processPatterns now.
Environment
Actual behavior
Getting the following error:
Expected behavior
No errors.
Steps to reproduce
We have a script to check if there is any defect in the generated TypeScript
.d.ts
build files. We usefast-glob
to traverse these build files. You can see the error in mui/material-ui#37789.Code sample
There is an error in the latest version 3.3.0 which you can see in this GitHub pull request: mui/material-ui#37789.
After some debugging and going through the stack trace, it appears that the error is caused by this line of code in the
processPatterns
function. TheprocessPatterns
function expects a pattern as its first argument (but here it issettings.ignore
), and the errorpattern.reduce() is not a function
occurs in theObject.expandPatternsWithBraceExpansion
function. ThebraceExpansion
option is set to true by default, triggering theexpandPatternsWithBraceExpansion
function. ButThe text was updated successfully, but these errors were encountered: