Comments (20)
Please download version v3.0.5 for corrected type declarations. Additionally, this issue has been remediated fully by release v3.0.4, so I'm going to close this issue. Thank you all for your patience up to this point. Please open a new issue if you continue to see related issues.
from stripe-js.
Please download version v3.0.5 for corrected type declarations. Additionally, this issue has been remediated fully by release v3.0.4, so I'm going to close this issue. Thank you all for your patience up to this point. Please open a new issue if you continue to see related issues.
looks great, thanks @fruchtose-stripe
from stripe-js.
We are actively investigating the best path forward for fixing this issue. In the meantime, we recommend usage of version 2.4.0
, which is our last stable release. Thank you for your patience with this issue.
from stripe-js.
Perhaps related to #545.
from stripe-js.
Thank you for bringing up this issue with our team. We have published a new release which should resolve the issues you were having. Please upgrade to v3.0.1 instead of v3.0.0. Let us know if you continue to encounter any issues!
from stripe-js.
Getting an error when working within VSCode:
Could not find a declaration file for module '@stripe/stripe-js'. '/node_modules/@stripe/stripe-js/dist/stripe.mjs' implicitly has an 'any' type.
There are types at '/node_modules/@stripe/stripe-js/types/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@stripe/stripe-js' library may need to update its package.json or typings.ts(7016)
On StackOverflow I found this answer that may lead to the fix, which amounts to defining the types in each "exports"
entry:
https://stackoverflow.com/a/77566206/3574250
from stripe-js.
@TheSeg are you on version v3.0.0
or v3.0.1
when encountering this error?
from stripe-js.
@TheSeg are you on version
v3.0.0
orv3.0.1
when encountering this error?
v3.0.1
. I apologize for not stating that in the post!
from stripe-js.
They're still not correct: https://publint.dev/@stripe/[email protected]
from stripe-js.
This is another useful linter to help: https://arethetypeswrong.github.io/?p=%40stripe%2Fstripe-js%403.0.1
from stripe-js.
Hi @TheSeg. Could you please share what version of Node.js you're using, as well as your moduleResolution
setting from tsconfig.json
?
from stripe-js.
Sorry for not following up! v3.0.2
is all good for me now.
To answer your question, these are the relevant settings:
"moduleResolution": "bundler",
"customConditions": [
"browser",
],
from stripe-js.
@TheSeg Thank you. That's very helpful. I'm working on a new PR to fix this issue more thoroughly.
from stripe-js.
Yup, it's functioning correctly now. I have a PR to remove the deprecated field: #547. The other one you'll want to set is the type to module. Then it should pass lint fine.
from stripe-js.
This might be somewhat orthongonal to the issue reported in this ticket but pure.d.ts
and index.d.ts
type defintions are now incompatible with one another (typescript version 5.3.3 and skipLibCheck
is not turned on). I don't fully understand why dist/index.d.ts
is also being checked here since I only have a single import for @stripe/stripe-js/pure
, but I am also using @stripe/react-stripe-js
so maybe its sneaking in that way.
node_modules/@stripe/stripe-js/pure/index.d.ts:12618:5 - error TS2717: Subsequent property declarations must have the same type. Property 'Stripe' must be of type 'StripeConstructor | undefined', but here has type 'StripeConstructor | undefined'.
12618 Stripe?: StripeConstructor;
~~~~~~
node_modules/@stripe/stripe-js/dist/index.d.ts:12622:5
12622 Stripe?: StripeConstructor;
~~~~~~
'Stripe' was also declared here.
Found 1 error in node_modules/@stripe/stripe-js/pure/index.d.ts:12618```
from stripe-js.
Hi @dairyisscary. Thank you for this bug report. I have merged #560 to address it.
from stripe-js.
Related Issues (20)
- [BUG]: TypeError "stripe is null" HOT 2
- [BUG]: Warnings Reported In the Console over Content Security Policy HOT 5
- [BUG]: Stripe.js Attempting to JSON.parse '[object Object]' HOT 2
- [BUG]: `CardElement` conditional rendering triggers "IntegrationError: We could not retrieve data from the specified Element." HOT 7
- [BUG]: Error when paying with cashapp HOT 2
- [BUG]: Invalid initEmbeddedCheckout(options) parameter: locale is not an accepted parameter. HOT 1
- [BUG]: type regression with moduleResolution: bundler HOT 3
- [BUG]: Google's third party cookies HOT 7
- [BUG]: compile error: loadStripe isn't found in @stripe/stripe-js/pure as of 3.0 HOT 13
- [BUG]: Missing type ConfirmCashappSetupOptions in "@stripe/[email protected]" HOT 3
- > we pick things up alphabetically HOT 1
- [BUG]: Possible mismatched types between regular and pure HOT 3
- [BUG]: TypeScript error on Elements options HOT 3
- [BUG]: Uncaught Error Error: Frame not initialized when using React StrictMode HOT 1
- [BUG]: Google Pay PaymentRequestButtonElement subscribe HOT 2
- [BUG]: Problem type with loadStripe HOT 4
- [BUG]: build error HOT 4
- [BUG]: onComplete does not trigger when using fetchClientSecret in Stripe's initEmbeddedCheckout HOT 1
- [BUG]: StripeElements defaultValues aren't working HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stripe-js.