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

Types in @atproto/api are broken #3048

Open
nzakas opened this issue Nov 19, 2024 · 0 comments
Open

Types in @atproto/api are broken #3048

nzakas opened this issue Nov 19, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@nzakas
Copy link

nzakas commented Nov 19, 2024

Describe the bug

The types in @atproto/api appear to be missing some references.

To Reproduce

Steps to reproduce the behavior:

  1. Start a new TypeScript project
  2. Install @atproto/api
  3. Add a sample file using AtpAgent
  4. Run npx tsc to run the TypeScript compiler

Repro case:
https://stackblitz.com/edit/stackblitz-starters-tg3qyc?file=tsconfig.json

Run npx tsc on the command line.

Expected behavior

Project should compile without errors.

Actual Behavior

I get the following errors:

$ npx tsc
node_modules/@atproto/xrpc/dist/client.d.ts:11:85 - error TS2304: Cannot find name 'BodyInit'.

11     call(serviceUri: string | URL, methodNsid: string, params?: QueryParams, data?: BodyInit | null, opts?: CallOptions): Promise<import("./types").XRPCResponse>;       
                                           
                                           
 ~~~~~~~~

node_modules/@atproto/xrpc/dist/util.d.ts:9:65 - error TS2304: Cannot find name 'HeadersInit'.

9 export declare function combineHeaders(headersInit: undefined | HeadersInit, defaultHeaders?: Iterable<[string, undefined | Gettable<null | string>]>): undefined | HeadersInit;
                                           
                       ~~~~~~~~~~~

node_modules/@atproto/xrpc/dist/util.d.ts:9:165 - error TS2304: Cannot find name 'HeadersInit'.

9 export declare function combineHeaders(headersInit: undefined | HeadersInit, defaultHeaders?: Iterable<[string, undefined | Gettable<null | string>]>): undefined | HeadersInit;
                                           
                                           
                                           
                                     ~~~~~~~~~~~

node_modules/@atproto/xrpc/dist/util.d.ts:10:62 - error TS2304: Cannot find name 'BodyInit'.

10 export declare function isBodyInit(value: unknown): value is BodyInit;
                                           
                     ~~~~~~~~

node_modules/@atproto/xrpc/dist/util.d.ts:12:81 - error TS2304: Cannot find name 'BodyInit'.

12 export declare function encodeMethodCallBody(headers: Headers, data?: unknown): BodyInit | undefined;
                                           
                                        ~~~~~~~~


Found 5 errors in 2 files.

Errors  Files
     1  node_modules/@atproto/xrpc/dist/client.d.ts:11
     4  node_modules/@atproto/xrpc/dist/util.d.ts:9

Details

  • Operating system: Windows
  • Node version: v22.9.0

Additional context

@nzakas nzakas added the bug Something isn't working label Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant