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

Error with stripe package #42

Closed
aegooby opened this issue Apr 1, 2021 · 6 comments
Closed

Error with stripe package #42

aegooby opened this issue Apr 1, 2021 · 6 comments

Comments

@aegooby
Copy link

aegooby commented Apr 1, 2021

Using the https://esm.sh/stripe package gives the error,

error: TS2439 [ERROR]: Import or export declaration in an ambient module declaration cannot reference module through relative module name.
    export * from '/v33/@types/[email protected]/http.d.ts';
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    at https://cdn.esm.sh/v33/@types/[email protected]/http.d.ts:2:5

TS2439 [ERROR]: Import or export declaration in an ambient module declaration cannot reference module through relative module name.
    import * as stream from '/v33/node:stream';
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    at https://cdn.esm.sh/v33/@types/[email protected]/http.d.ts:6:5

TS2439 [ERROR]: Import or export declaration in an ambient module declaration cannot reference module through relative module name.
    import { URL } from '/v33/node:url';
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    at https://cdn.esm.sh/v33/@types/[email protected]/http.d.ts:7:5

TS2439 [ERROR]: Import or export declaration in an ambient module declaration cannot reference module through relative module name.
    import { Socket, Server as NetServer } from '/v33/node:net';
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    at https://cdn.esm.sh/v33/@types/[email protected]/http.d.ts:8:5

Trying with https://esm.sh/stripe?no-check gives,

error: Uncaught ReferenceError: require is not defined
    at https://cdn.esm.sh/v33/[email protected]/deno/stripe.js:4:12741
    at https://cdn.esm.sh/v33/[email protected]/deno/stripe.js:1:763
    at https://cdn.esm.sh/v33/[email protected]/deno/stripe.js:4:23152
    at https://cdn.esm.sh/v33/[email protected]/deno/stripe.js:1:763
    at https://cdn.esm.sh/v33/[email protected]/deno/stripe.js:4:29463
    at https://cdn.esm.sh/v33/[email protected]/deno/stripe.js:1:763
    at https://cdn.esm.sh/v33/[email protected]/deno/stripe.js:5:10580
    at https://cdn.esm.sh/v33/[email protected]/deno/stripe.js:1:763
    at https://cdn.esm.sh/v33/[email protected]/deno/stripe.js:5:15340
    at https://cdn.esm.sh/v33/[email protected]/deno/stripe.js:1:763
@ije
Copy link
Member

ije commented Apr 1, 2021

stripe is using the child_process that is not supported by deno currently

@aegooby
Copy link
Author

aegooby commented Apr 1, 2021

According to this issue and this pull request in the Stripe repository it seems that they are moving towards (or maybe have already completed) removing the dependency on child_process so it can be used in CloudFlare workers, which has API similar to Deno with regards to Stripe according to the maintainers. It seems the only thing left is Node http/https either being polyfilled or converted to use fetch() instead.

I am uneducated on the process of converting modules to Deno, but seeing as the Stripe package is important to my projects I am willing to help out with the porting if needed.

@talentlessguy
Copy link
Contributor

still happens on v47

Check file:///tmp/test.ts
error: TS2439 [ERROR]: Import or export declaration in an ambient module declaration cannot reference module through relative module name.
    import * as stream from '/v47/node:stream';
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    at https://cdn.esm.sh/v47/@types/[email protected]/http.d.ts:43:5

TS2439 [ERROR]: Import or export declaration in an ambient module declaration cannot reference module through relative module name.
    import { URL } from '/v47/node:url';
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    at https://cdn.esm.sh/v47/@types/[email protected]/http.d.ts:44:5

TS2439 [ERROR]: Import or export declaration in an ambient module declaration cannot reference module through relative module name.
    import { Socket, Server as NetServer } from '/v47/node:net';
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    at https://cdn.esm.sh/v47/@types/[email protected]/http.d.ts:45:5

TS2439 [ERROR]: Import or export declaration in an ambient module declaration cannot reference module through relative module name.
    export * from '/v47/@types/[email protected]/http.d.ts';
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    at https://cdn.esm.sh/v47/@types/[email protected]/http.d.ts:1357:5

@ije
Copy link
Member

ije commented Sep 6, 2021

https://esm.sh/stripe?no-check should work

@ije
Copy link
Member

ije commented Sep 6, 2021

I will check the types transformer

@talentlessguy
Copy link
Contributor

seems to work fine in v53

feel free to reopen if it persists

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants