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

request.d.ts compile error for browsers #622

Closed
Kaishiyoku opened this issue Aug 20, 2024 · 3 comments · Fixed by #623
Closed

request.d.ts compile error for browsers #622

Kaishiyoku opened this issue Aug 20, 2024 · 3 comments · Fixed by #623

Comments

@Kaishiyoku
Copy link
Contributor

When I try to build my project with tsc && vite build it fails due to the following exception:

node_modules/ky/distribution/types/request.d.ts:2:113 - error TS2694: Namespace 'global.NodeJS' has no exported member 'ArrayBufferView'.

2 type UndiciBodyInit = ArrayBuffer | AsyncIterable<Uint8Array> | Blob | FormData | Iterable<Uint8Array> | NodeJS.ArrayBufferView | URLSearchParams | null | string;
                                                                                                                  ~~~~~~~~~~~~~~~


Found 1 error in node_modules/ky/distribution/types/request.d.ts:2
@sholladay
Copy link
Collaborator

I think the NodeJS namespace can just be removed. Does it compile if you do that?

I'm not sure if that would cause a problem in Node, though.

@Kaishiyoku
Copy link
Contributor Author

I think the NodeJS namespace can just be removed. Does it compile if you do that?

I'm not sure if that would cause a problem in Node, though.

This works. But also don't know if this would break Node projects.

@sholladay
Copy link
Collaborator

Ky targets browsers first and foremost, so I think we should go ahead and make that change.

PR welcome. Otherwise I'll take care of it soon.

Kaishiyoku added a commit to Kaishiyoku/ky that referenced this issue Aug 21, 2024
Kaishiyoku added a commit to Kaishiyoku/ky that referenced this issue Aug 21, 2024
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

Successfully merging a pull request may close this issue.

2 participants