Cannot find module 'url'
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 581
- Forks
- 22
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
When I add httpie to an angular project I get the following error:
```
Error: node_modules/httpie/index.d.ts:1:21 - error TS2307: Cannot find module 'url' or its corresponding type declarations.
1 import { Url } from 'url';
```
As a workaround, I just removed the 'import' statement and the 'Url' references and it seems to work fine.
```
export function send(method: string, uri: string | URL, opts?: Partial): Promise>;
declare function method(uri: string | URL, opts?: Partial): Promise>;
```
If it really doesn't break anything, maybe this patch can be pushed to the repository.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with node_modules/httpie/index.d.ts and inspect the import of Url from 'url' and its references in the declarations. Reproduce the Angular TypeScript error, then verify that the declarations compile without the missing-module error while preserving the send and method API types.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, javascript, nodejs, typescript
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100