Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to 0.29.0 got problems with axios.d.js and bluebird.d.js #2116

Closed
casertap opened this issue Jul 22, 2016 · 4 comments
Closed

Update to 0.29.0 got problems with axios.d.js and bluebird.d.js #2116

casertap opened this issue Jul 22, 2016 · 4 comments
Labels
declarations Issues with library definitions or .js.flow features Typing: polymorphism

Comments

@casertap
Copy link

casertap commented Jul 22, 2016

Here is my output after I updated from 0.27.0 to 0.29.0

[0] node_modules/flow-interfaces/interfaces/axios.d.js:27
[0]  27:       successHandler: ?(response: AxiosXHRConfig<T>) => Promise<AxiosXHRConfig> | AxiosXHRConfig,
[0]                                                                      ^^^^^^^^^^^^^^ Library type error:
[0]  27:       successHandler: ?(response: AxiosXHRConfig<T>) => Promise<AxiosXHRConfig> | AxiosXHRConfig,
[0]                                                                      ^^^^^^^^^^^^^^ AxiosXHRConfig. Application of polymorphic type needs <list of 1 argument>. (Can use `*` for inferrable ones)
[0]
[0] node_modules/flow-interfaces/interfaces/axios.d.js:27
[0]  27:       successHandler: ?(response: AxiosXHRConfig<T>) => Promise<AxiosXHRConfig> | AxiosXHRConfig,
[0]                                                                                        ^^^^^^^^^^^^^^ Library type error:
[0]  27:       successHandler: ?(response: AxiosXHRConfig<T>) => Promise<AxiosXHRConfig> | AxiosXHRConfig,
[0]                                                                                        ^^^^^^^^^^^^^^ AxiosXHRConfig. Application of polymorphic type needs <list of 1 argument>. (Can use `*` for inferrable ones)
[0]
[0] node_modules/flow-interfaces/interfaces/bluebird.d.js:106
[0] 106:   reflect(): Promise<PromiseInspection>;
[0]                           ^^^^^^^^^^^^^^^^^ Library type error:
[0] 106:   reflect(): Promise<PromiseInspection>;
[0]                           ^^^^^^^^^^^^^^^^^ PromiseInspection. Application of polymorphic type needs <list of 1 argument>. (Can use `*` for inferrable ones)
[0]
[0] node_modules/flow-interfaces/interfaces/bluebird.d.js:118
[0] 118:   promise: Promise;
[0]                 ^^^^^^^ Library type error:
[0] 118:   promise: Promise;
[0]                 ^^^^^^^ Promise. Application of polymorphic type needs <list of 1 argument>. (Can use `*` for inferrable ones)
[0]
[0]
[0] Found 4 errors

npm ls axios

no result

npm ls bluebird

react-redux-universal-hot-example@0.9.0 /Users/pc/js/react/react-redux-universal-hot-example
├─┬ concurrently@0.1.1
│ └── bluebird@2.9.6
├─┬ eslint@2.13.1
│ └─┬ table@3.7.8
│   └── bluebird@3.4.1
└─┬ karma@1.1.1
  └── bluebird@3.4.1
@avikchaudhuri
Copy link
Contributor

Not sure I understand all the errors but definitely the last one in bluebird should be Promise<T> for some T. We made a recent change where we require type arguments to be passed in explicitly to generic types. cc @bhosmer

Where are you getting the interfaces from? See also https://github.com/flowtype/flow-typed

@avikchaudhuri avikchaudhuri added Typing: polymorphism declarations Issues with library definitions or .js.flow features labels Jul 22, 2016
@casertap
Copy link
Author

The errors actually come from this library in my node_modules: "flow-interfaces": "^0.6.1"
How can I declare things to solve this library type problems?

@casertap
Copy link
Author

I understand my problem, I am using flow-interfaces and I have this config

[libs]
./node_modules/flow-interfaces/interfaces/
./interfaces/

I will try to install flow-typed for my libs

@casertap
Copy link
Author

I solved the issue by just adding the flow-interfaces definitions that I actually use and not all of them at one.
I installed one flow-typed package

flow-typed install -f 0.29 redux@3.5.2

my config file look like such:

[libs]
./node_modules/flow-interfaces/interfaces/react-redux.d.js
./node_modules/flow-interfaces/interfaces/CSSModule.d.js
./flow-typed/npm/
./interfaces/

module.name_mapper.extension='scss' -> 'CSSModule'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
declarations Issues with library definitions or .js.flow features Typing: polymorphism
Projects
None yet
Development

No branches or pull requests

2 participants