As of version 0.42 (and upwards to 0.45 tested) flow breaks for me reporting Recursion limit reached on immutable.js exports. I am almost sure that the problem is not actually in the immutable type defs, it is probable just the export that triggered the error. But I have no clue how to solve this problem, can anyone give me a hint on how to proceed?
node_modules/immutable/dist/immutable.js.flow:662
662: is,
^^ export {is}. *** Recursion limit exceeded ***
87: import { Record, List, Map, Set, fromJS, Iterable } from 'immutable';
^^^^^^^^^^^ immutable. See: src/components/Planning/planning-reducer.js:87
node_modules/immutable/dist/immutable.js.flow:662
662: is,
^^ export {is}. *** Recursion limit exceeded ***
3: import { fromJS, List, Map, Record, OrderedMap } from 'immutable';
^^^^^^^^^^^ immutable. See: src/components/Planning/planning-selectors.js:3
Found 2 errors
Same issue for me using flow 0.46.0. I鈥檝e got [email protected] installed.
Occurred to me that this could be specific to a particular libdef for immutable, but I verified that I don鈥檛 have any installed for immutable-js in flow-typed/npm. Which makes me think that one way around this could be a custom immutable libdef based on the one from master but that doesn鈥檛 result in the Recursion limit exceeded error. I鈥檇 love to give it a try, but I have no idea where I would being to debug an issue like this.
Anyone has a clue on how to debug this? I can not move forward past release 0.41.0, it fails for all releases from 0.42.0 until 0.50.0
@hmeerlo I don鈥檛 know how to debug this. However, I was able to get it to stop occurring in my codebase, which is a great relief. We had a particularly long and complicated reducer file that was 1379 lines long (and was the file where flow was reporting the Recursion limit exceeded error), and when I refactored around 200 lines of reducer logic out of it into a separate file, flow stopped getting stuck on the immutable-js recursion issue and went back to successfully type-checking the file (and our entire code base).
@acusti I worked around it as well by refactoring some code. Running flow check --traces 50 was of great help to point me towards the code where the problem actually arose.
Most helpful comment
Same issue for me using flow 0.46.0. I鈥檝e got [email protected] installed.