Describe the bug
If the DOM library declaration is not included in tsconifg.json
, then compilation fails in connect-core
with the error:
node_modules/@bufbuild/connect-core/dist/types/call-options.d.ts (13:15)
13 headers?: HeadersInit;
~~~~~~~~~~~
I would assume this type is only used for browser-side code so it would be great if it's possible to avoid adding DOM as a library for a server-side application.
To Reproduce
connect-node
with lib
option set to e.g. ["ESNext"]
in tsconfig.json
.Environment:
0.7.0
0.7.0
18.14.0
This is not just used in browser contexts. Fetch is also available in Node starting in Node v18+. Going forward, the right approach would be to correctly use the right types for the environment that you are targeting with your tsconfig.json. E.g. using @types/node
(https://github.com/DefinitelyTyped/DefinitelyTyped) in the types
field in tsconfig.json. Sadly, fetch is not included in there yet, hence DOM is your second best option (or using @types/web
as a workaround).
See also: DefinitelyTyped/DefinitelyTyped#60924
Owner Name | bufbuild |
Repo Name | connect-es |
Full Name | bufbuild/connect-es |
Language | TypeScript |
Created Date | 2022-02-16 |
Updated Date | 2023-03-24 |
Star Count | 852 |
Watcher Count | 20 |
Fork Count | 33 |
Issue Count | 17 |
Issue Title | Created Date | Updated Date |
---|