actions / http-client

A lightweight HTTP client optimized for use with actions, TypeScript with generics and async await.
https://github.com/features/actions
Other
72 stars 33 forks source link

v1.0.9 fails to compile using TypeScript with TS2304 error #37

Closed martincostello closed 3 years ago

martincostello commented 3 years ago

Using TypeScript with ncc to compile a dist folder as described in the documentation for actions generates a compilation error when using actions/http-client v1.0.9:

Error: node_modules/@actions/http-client/interfaces.d.ts(29,16): error TS2304: Cannot find name 'URL'.

Example build

martincostello commented 3 years ago

Required an update from es6 to es2019 in my tsconfig.json.

konradpabjan commented 3 years ago

Hit this same problem. My solution was to remove "lib": ["es6"] from tsconfig. If anyone is curious: https://github.com/actions/toolkit/pull/760#discussion_r608013178