immutable-js: Error in the new version of flow 0.55
Library in version : immutable@4.0.0-rc.2
To get this error just run flow:
Error: node_modules/immutable/dist/immutable.js.flow:519
519: static of<T>(...values: T[]): SetSeq<T>;
^^^^^^^^^ SetSeq. This type is incompatible with
383: static of<T>(...values: T[]): IndexedSeq<T>;
^^^^^^^^^^^^^ IndexedSeq
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 29
- Comments: 18 (4 by maintainers)
Commits related to this issue
- Remove line to fix issue in Flow 0.55 (See: https://github.com/facebook/immutable-js/issues/1308) — committed to DocSpring/immutable-js by ndbroadbent 7 years ago
- Remove line to fix issue in Flow 0.55 (See: https://github.com/facebook/immutable-js/issues/1308) — committed to DocSpring/immutable-js by ndbroadbent 7 years ago
- Remove line to fix issue in Flow 0.55 (See: https://github.com/facebook/immutable-js/issues/1308) — committed to DocSpring/immutable-js by ndbroadbent 7 years ago
- Remove line to fix issue in Flow 0.55 (See: https://github.com/facebook/immutable-js/issues/1308) — committed to DocSpring/immutable-js by ndbroadbent 7 years ago
- Remove of<T> for Seq Per https://github.com/facebook/immutable-js/issues/1308#issuecomment-331061620 — committed to rgbkrk/immutable-js by rgbkrk 7 years ago
- Remove of<T> for Seq (#1310) * Remove of<T> for Seq Per https://github.com/facebook/immutable-js/issues/1308#issuecomment-331061620 * Remove of<T> for Seq — committed to immutable-js/immutable-js by rgbkrk 7 years ago
- BREAKING: Remove Seq.of() This function causes type safety issues as Seq is a baseclass and superclass methods also include .of(). `Seq.of(a, b)` can always be safely replaced with `Seq.Indexed.of(a... — committed to immutable-js/immutable-js by leebyron 7 years ago
- BREAKING: Remove Seq.of() (#1311) This function causes type safety issues as Seq is a baseclass and superclass methods also include .of(). `Seq.of(a, b)` can always be safely replaced with `Seq.In... — committed to immutable-js/immutable-js by leebyron 7 years ago
- Fix immutable typings Found solution at https://github.com/facebook/immutable-js/issues/1308#issuecomment-375846684 Hopefully immutable.js 4.x fixes this — committed to uber/nebula.gl by supersonicclay 6 years ago
OK I could work around this issue without having to update to
4.0.0
, which I can’t do ATM. Here are the instructions: https://gist.github.com/fabiomcosta/617ef69320a5539ab5cdc510b0b648afAny chance you can publish this as a third party definition in https://github.com/flowtype/flow-typed? I think this would make it a lot easier to work on flow types collaboratively (i.e for https://github.com/facebook/immutable-js/issues/1223).
Agreeing with @philipp-spiess here. Simply commenting out a line in node_modules seems like a pretty nasty work around, since every dev on the team will need to do this every time they download the project. Porting these flow types over to
flow-typed
will allow me to persist this to the repo more easily.I think removing
Seq.of
is the right call, even though it’s breaking. It’s really just an alias forIndexedSeq.of
and also a less commonly used API. Will include in the next release.I’ve forked and pushed a branch to remove this line. Feel free to use my fork to get rid of the flow errors.
If you’re using yarn:
Or add this line to your
package.json
:I agree with @philipp-spiess and @duro, it would be good to either port these types to
flow-typed
so that it’s easier to fix them manually. But releasing a new version with the fix would be really nice.@tanem Right. It seems we have a local copy of the type definitions, so the change I made isn’t going to sync out (we should keep these in sync, but alas).
I’m lazy, so I probably won’t submit a PR, but feel free to use my explanation above. You’re right on about removing that one line. It’s a breaking change, but I’m not sure how this project deals with that.
@fabiomcosta Thanks, that solved my problem!