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

Flow type checking fails - Cannot use InAppPurchase as a type because it is an any-typed value. #1341

Closed
rimzici opened this issue May 18, 2021 · 2 comments
Labels
🙏 help wanted Extra attention is needed 🍚 need contribution Need PR ❄️ types Typing issues

Comments

@rimzici
Copy link

rimzici commented May 18, 2021

With RN v0.64.1 and flow-bin v^0.137.0, the flow fails with the following error

Cannot use InAppPurchase as a type because it is an any-typed value. Type InAppPurchase properly, so it is no longer any-typed, to use it as an annotation. [value-as-type]

I am importing as follows

import {
	purchaseErrorListener,
	purchaseUpdatedListener,
	type ProductPurchase,
	type PurchaseError,
	type InAppPurchase,
	type SubscriptionPurchase,
} from 'react-native-iap';

Used to work fine with "flow-bin": "^0.122.0" and "react-native": "0.63.4"

Version of react-native-iap

"react-native-iap": "^6.0.6"

Version of react-native

"react-native": "0.64.1"

Platforms you faced the error (IOS or Android or both?)

Expected behavior

flow should pass

Actual behavior

flow type checking fails

Tested environment (Emulator? Real Device?)

Steps to reproduce the behavior

Configure and run flow

@hyochan hyochan added ❄️ types Typing issues 🍚 need contribution Need PR 🙏 help wanted Extra attention is needed labels May 18, 2021
@hyochan
Copy link
Owner

hyochan commented May 18, 2021

Honestly, I don't know much about flow. I am just relying on flowgen for flow typing. Could you open up issue there too?

@hyochan
Copy link
Owner

hyochan commented Jun 15, 2021

@rimzici Looks like #1377 was causing a problem.

This fix is released in 6.2.1. Please come back if you still face the problem.

@hyochan hyochan closed this as completed Jun 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙏 help wanted Extra attention is needed 🍚 need contribution Need PR ❄️ types Typing issues
Projects
None yet
Development

No branches or pull requests

2 participants