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

Missing 'URL' import #295

Closed
2 tasks done
rsclarke-vgw opened this issue Oct 21, 2021 · 3 comments
Closed
2 tasks done

Missing 'URL' import #295

rsclarke-vgw opened this issue Oct 21, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@rsclarke-vgw
Copy link

rsclarke-vgw commented Oct 21, 2021

What happened?

When using tsc to compile using node the following error occurs;

node_modules/jose/dist/types/jwks/remote.d.ts:7:49 - error TS2304: Cannot find name 'URL'.

7 export declare function createRemoteJWKSet(url: URL, options?: RemoteJWKSetOptions): GetKeyFunction<JWSHeaderParameters, FlattenedJWSInput>;
    

I believe jwks/remote.ts requires;

import { URL } from 'url';

Version

v4.1

Runtime

Node.js

Runtime Details

v14.18.1

Code to reproduce

-

  • I have searched the issues tracker and discussions for similar topics and couldn't find anything related.
  • I agree to follow this project's Code of Conduct
@panva
Copy link
Owner

panva commented Oct 21, 2021

Please provide the code/tiny project to reproduce. URL is a global in all supported Node.js versions.

@panva
Copy link
Owner

panva commented Oct 21, 2021

This needs to be solved upstream in DefinitelyTyped DefinitelyTyped/DefinitelyTyped#34960

For the time being you can solve by adding dom to the libs in tsconfig.json.

@panva panva added bug Something isn't working and removed triage labels Oct 21, 2021
@panva
Copy link
Owner

panva commented Oct 21, 2021

I'll label this as a bug and fix it, nevertheless it's a workaround for an issue in Node.js types from @types/node.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants