Skip to content
This repository has been archived by the owner on Mar 27, 2021. It is now read-only.

Flow could not resolve ElementShape nor StripeShape #87

Closed
puradox opened this issue Sep 20, 2017 · 2 comments
Closed

Flow could not resolve ElementShape nor StripeShape #87

puradox opened this issue Sep 20, 2017 · 2 comments

Comments

@puradox
Copy link

puradox commented Sep 20, 2017

Flow is still being finicky, as usual 🤦‍♂️
I believe these errors have something to do with how this library is being packaged.

I'm running the latest version of Flow, v0.54.1, and react-stripe-elements, v1.0.1.

Error: node_modules/react-stripe-elements/src/components/Element.js:87
 87:     _element: ElementShape;
                   ^^^^^^^^^^^^ identifier `ElementShape`. Could not resolve name

Error: node_modules/react-stripe-elements/src/components/Elements.js:11
 11:   elements: ElementsShape,
                 ^^^^^^^^^^^^^ identifier `ElementsShape`. Could not resolve name

Error: node_modules/react-stripe-elements/src/components/Elements.js:12
 12:   registerElement: (type: string, element: ElementShape) => void,
                                                ^^^^^^^^^^^^ identifier `ElementShape`. Could not resolve name

Error: node_modules/react-stripe-elements/src/components/Provider.js:11
 11:   stripe: StripeShape,
               ^^^^^^^^^^^ identifier `StripeShape`. Could not resolve name

Error: node_modules/react-stripe-elements/src/components/inject.js:73
 73:     requireElement = (specifiedType: string): ElementShape => {
                                                   ^^^^^^^^^^^^ identifier `ElementShape`. Could not resolve name

Error: node_modules/react-stripe-elements/src/components/inject.js:85
 85:     findElement = (specifiedType: string): ?ElementShape => {
                                                 ^^^^^^^^^^^^ identifier `ElementShape`. Could not resolve name


Found 6 errors
error Command failed with exit code 2.
@puradox
Copy link
Author

puradox commented Sep 20, 2017

Relates with #6

@asolove-stripe
Copy link
Contributor

asolove-stripe commented Dec 13, 2017

Hey @puradox, did you get a resolution to this problem? It looks like the issue is that flow is checking types on node_modules, which in general isn't a great idea. Recently, as of flow 0.57, it no longer checks types of files inside node_modules by default, so we expect this should be solved by upgrading to that or updating your config to tell flow not to run over some of your dependencies.

Because of that upstream fix with flow's config change, I think I'm going to close this issue on type failures in node_modules/react-stipe-elements. But let me know if there's a reason this should be addressed here and I'm happy to reopen. We'll use #6 to track questions about exporting flow types for your application to check against.

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

2 participants