Skip to content
This repository has been archived by the owner on Dec 29, 2018. It is now read-only.

Reduce of empty array with no initial value #119

Open
tbillington opened this issue Jul 26, 2016 · 7 comments
Open

Reduce of empty array with no initial value #119

tbillington opened this issue Jul 26, 2016 · 7 comments

Comments

@tbillington
Copy link

ran monocle, got

monocle -c index.html -j js -b main.6b90ebb85e95149b7fca.js
Starting to strip comments from bundle file...
Took 1.104 seconds to strip comments input bundle file
/usr/local/lib/node_modules/react-monocle/src/previewParser.js:162
    .reduce((prev, curr) => {
     ^

TypeError: Reduce of empty array with no initial value
    at Array.reduce (native)
    at getComponentName (/usr/local/lib/node_modules/react-monocle/src/previewParser.js:162:5)
    at Object.modifySetStateStrings (/usr/local/lib/node_modules/react-monocle/src/previewParser.js:231:35)
    at /usr/local/lib/node_modules/react-monocle/bin/cmd.js:41:38
    at Object.<anonymous> (/usr/local/lib/node_modules/react-monocle/bin/cmd.js:57:3)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:441:10)
@nhavar
Copy link

nhavar commented Jul 26, 2016

Same here. Is this because I'm using Redux and Router. I see Issues with those not being supported.

@mosse
Copy link

mosse commented Jul 26, 2016

+1

@mbchoa
Copy link
Member

mbchoa commented Jul 27, 2016

@tbillington @mosse Hey guys! Thanks for the quick feedback.

Currently, we're supporting Webpack, Gulp, Rollup, Browserify as the main bundling tools that we take account for when parsing through your bundle file. Are you guys using these bundling tools?

Secondly, we require that the bundle file be unmangled/unminified for the purposes of reading through it to get the component information.

@mbchoa
Copy link
Member

mbchoa commented Jul 27, 2016

@nhavar Yes, we currently don't support React Router and Redux as a part of the developer's React app. However, we do have plans for supporting them in the near future.

@m1n0s
Copy link

m1n0s commented May 1, 2017

@mbchoa, it is nothing have been changed till now, isn't it?

@DrJukka
Copy link

DrJukka commented Mar 6, 2018

appears to be the situation also still

@MomchilGorchev
Copy link

Same here

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants