whenDev, whenCI is not a function or its return value is not iterable
See original GitHub issueI am getting the following error when using when, whenDev and whenCI functions in craco.config.js
TypeError: whenDev(...) is not a function or its return value is not iterable
at Object.<anonymous> (/Users/asantikari/Documents/git/sc-spike/new-cart/craco.config.js:22:10)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at loadCracoConfig (/Users/asantikari/Documents/git/sc-spike/new-cart/node_modules/@craco/craco/lib/config.js:48:20)
at Object.<anonymous> (/Users/asantikari/Documents/git/sc-spike/new-cart/node_modules/@craco/craco/scripts/build.js:16:21)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
My config looks like this.
module.exports = {
webpack: {
plugins: [
...whenDev(() => [
new BundleAnalyzerPlugin({
analyzerMode: 'static',
reportFilename: '../bundle-stats/report.html',
openAnalyzer: false,
logLevel: 'error',
}),
]),
],
}
}
CRACO Version: 3.2.3
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
whenDev, whenCI is not a function or its return value ... - GitHub
I am getting the following error when using when, whenDev and whenCI functions in craco.config.js TypeError: whenDev(...) is not a function ...
Read more >The meaning of "'x' is not a function or its return value is not ...
Yes, there is meaning to both parts of the error message. In the case you have at hand, the return value of Symbol()...
Read more >object is not a function or its return value is not iterable
I have a small React hook that is wrapping a class component and I am trying to pass a state from this hook...
Read more >TypeError: 'x' is not iterable - JavaScript - MDN Web Docs
The JavaScript exception "is not iterable" occurs when the value which is given as the right-hand side of for...of, as argument of a...
Read more >is not a function or its return value is not iterable in ReactJs ...
TypeError: react__WEBPACK_IMPORTED_MODULE_0_default is not a function or its return value is not iterable 1 | import useState from 'react'; ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @ashishsantikari
Everything seems fine for
whenDev
, do you have a repro case?As for
whenCI
, sorry I meant to remove it in a previous release but I didn’t see it through and the documentation hasn’t been updated accordingly. The updated documentation will be release soon.You can find an alternative here: https://github.com/sharegate/craco/blob/master/changelog/5.5.0.md
Thank you,
Patrick
@patricklafrance I am able to make it work now. It’s too complicated to debug problems in craco config.