Giter Site home page Giter Site logo

Comments (20)

fruchtose-stripe avatar fruchtose-stripe commented on August 20, 2024 1

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.

dairyisscary avatar dairyisscary commented on August 20, 2024 1

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.

cbala-stripe avatar cbala-stripe commented on August 20, 2024

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.

yktoo avatar yktoo commented on August 20, 2024

Perhaps related to #545.

from stripe-js.

maxwelly-stripe avatar maxwelly-stripe commented on August 20, 2024

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.

TheSeg avatar TheSeg commented on August 20, 2024

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.

maxwelly-stripe avatar maxwelly-stripe commented on August 20, 2024

@TheSeg are you on version v3.0.0 or v3.0.1 when encountering this error?

from stripe-js.

TheSeg avatar TheSeg commented on August 20, 2024

@TheSeg are you on version v3.0.0 or v3.0.1 when encountering this error?

v3.0.1. I apologize for not stating that in the post!

from stripe-js.

mikecousins avatar mikecousins commented on August 20, 2024

They're still not correct: https://publint.dev/@stripe/[email protected]

from stripe-js.

mikecousins avatar mikecousins commented on August 20, 2024

This is another useful linter to help: https://arethetypeswrong.github.io/?p=%40stripe%2Fstripe-js%403.0.1

from stripe-js.

fruchtose-stripe avatar fruchtose-stripe commented on August 20, 2024

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.

TheSeg avatar TheSeg commented on August 20, 2024

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.

fruchtose-stripe avatar fruchtose-stripe commented on August 20, 2024

@TheSeg Thank you. That's very helpful. I'm working on a new PR to fix this issue more thoroughly.

from stripe-js.

mikecousins avatar mikecousins commented on August 20, 2024

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.

dairyisscary avatar dairyisscary commented on August 20, 2024

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.

fruchtose-stripe avatar fruchtose-stripe commented on August 20, 2024

Hi @dairyisscary. Thank you for this bug report. I have merged #560 to address it.

from stripe-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.