Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/baseballyama/cacheable-request-bug
https://github.com/baseballyama/cacheable-request-bug
Last synced: 3 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/baseballyama/cacheable-request-bug
- Owner: baseballyama
- Created: 2022-09-03T03:30:25.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-09-03T04:59:19.000Z (over 2 years ago)
- Last Synced: 2024-11-11T04:49:51.286Z (about 1 month ago)
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Pre Process
Run `npm i`
## REPL steps
1. `module` is `commonjs` pattern.
Run `npx tsc --noEmit`.
Then below errors come.```
node_modules/@types/cacheable-request/index.d.ts(26,42): error TS2709: Cannot use namespace 'ResponseLike' as a type.
node_modules/@types/cacheable-request/index.d.ts(77,51): error TS2709: Cannot use namespace 'ResponseLike' as a type.
node_modules/@types/cacheable-request/index.d.ts(81,69): error TS2709: Cannot use namespace 'ResponseLike' as a type.
node_modules/@types/cacheable-request/index.d.ts(84,71): error TS2709: Cannot use namespace 'ResponseLike' as a type.
node_modules/@types/cacheable-request/index.d.ts(89,51): error TS2709: Cannot use namespace 'ResponseLike' as a type.
node_modules/@types/cacheable-request/index.d.ts(95,51): error TS2709: Cannot use namespace 'ResponseLike' as a type.
node_modules/@types/cacheable-request/index.d.ts(104,51): error TS2709: Cannot use namespace 'ResponseLike' as a type.
node_modules/@types/cacheable-request/index.d.ts(108,70): error TS2709: Cannot use namespace 'ResponseLike' as a type.
node_modules/@types/cacheable-request/index.d.ts(112,73): error TS2709: Cannot use namespace 'ResponseLike' as a type.
node_modules/@types/cacheable-request/index.d.ts(115,76): error TS2709: Cannot use namespace 'ResponseLike' as a type.
node_modules/@types/cacheable-request/index.d.ts(118,60): error TS2709: Cannot use namespace 'ResponseLike' as a type.
```2. `module` is `ESNext` pattern.
Run `npx tsc --noEmit`.
No error comes.## How to Fix it
After change require to import statement.
Then both `commonjs` and `ESNext` don't get error.
(But I couldn't pass tests of DefinitelyTyped...)```diff
// node_modules/@types/cacheable-request/index.d.ts
- import ResponseLike = require('responselike');
+ import ResponseLike from 'responselike';```