-
Notifications
You must be signed in to change notification settings - Fork 751
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
The library doesn't work on Deno. #1428
Comments
Thanks for reporting @aslakhellesoy |
i was able to make it work with some hack, since 3 weeks that stopped to work in production. |
Hitting this bug too. |
@fredguest if you need all my hack are available there: |
@riderx thanks for that! 👍 |
I would love to propose better support for Web-interoperable Runtimes like Cloudflare Workers and Deno. After a lot of hassle, I got this library working on Cloudflare Workers, but that required adding a lot of polyfills for Node APIs, which added 500kb+- to my bundle size. The Node APIs in question I get issues for are: I've used |
@ItsWendell in this video https://www.youtube.com/watch?v=epCHqHEdz8I they say they've done a bunch of refactoring specifically to support Deno and Cloudflare, which is encouraging, but clearly there's more work to be done. |
@ramya-stripe do you know if anyone has attempted to diagnose the issue recently? It sounds like it was working on Deno at one point, so it may be a quick fix to get it working again. |
Hey everyone, Unfortunately, we were not able to look into this recently, but will start definitely by the end of the week and try to diagnose the issue. Thanks for your patience here. |
Sorry for the delay in responding here. I was able to reproduce these failures in 1.21.3 and 1.21.1 (versions reported in the initial report) but when I upgrade to Deno 1.22.0 this resolves the issues. The produced errors are also type errors which are coming from the Deno internals rather than Stripe. @fredguest , @aslakhellesoy : Could you confirm your Deno versions and whether it still happens when you upgrade? @ItsWendell : Agreed going the web-interoperable runtime route would be ideal. For Cloudflare Workers, we actually explicitly removed the
If handling Webhooks:
You can see how this is configured in https://github.com/stripe-samples/stripe-node-deno-samples/tree/main/webhook-signing. |
@dcr-stripe thanks for looking into this. The bug I’m hitting may not actually be the same bug referred to in this issue, because I’m using Deno through Supabase edge functions (https://deno.com/blog/supabase-functions-on-deno-deploy) so the bug may be on the Supabase side. I created an issue on the Supabase repo supabase/supabase#7878 before I found this issue on the Stripe repo, but I don’t actually have visibility into what Deno version Supabase is using while managing Deno installations. I’ll reference this issue on the Supabase issue and see if I can get more information about the Deno version being used. |
Thanks for the fast response and looking into this! In the ideal world, this would be plug and play. We could have a "browser" / "worker" compatible export / build / bundle of I primarily use esbuild, where no-ops / polyfills are not as straight forward. I'll look into some examples of |
@dcr-stripe just to keep you posted, Stripe is working again in Supabase. The Supabase team identified a bug in Deno denoland/deno#15368 and released an update to the Supabase CLI that uses an older version of Deno supabase/cli#323 while they work with the Deno team to get the current version of Deno sorted. |
Going to close this out with the proposed fix from #1428 (comment), which is to use Deno 1.22.0. Please re-open if you're still experiencing issues with this. Thanks! |
Hey, we cant use npm: specifiers, so we are trying to import the stripe package from a CDN but our local code is not finding the types for the Stripe package. |
Hi @bombillazo ! Unfortunately, this is a known issue related to #1636 as we currently define our types in an ambient module, which doesn't play well with use cases like Deno where the stripe package is imported via a URL or alias. You may find this answer helpful - it suggests using an import map as a workaround. If that solution doesn't work for you, please open a new issue so we can keep better track of it! |
Describe the bug
It was fixed in #997, but as I've pointed out in #997 (comment), it doesn't work anymore. Maybe it's a regression.
To Reproduce
See stripe-samples/stripe-node-deno-samples#1 for a description on how to reproduce.
Expected behavior
No TypeScript errors.
Code snippets
No response
OS
macOS
Node version
Deno 1.21.3
Library version
Latest
API version
2020-08-27
Additional context
Deno compatibility should be verified in CI, to prevent regressions.
The text was updated successfully, but these errors were encountered: