Comments (11)
you will probably want to enable skipLibCheck, most of the default tsconfigs do https://github.com/tsconfig/bases/tree/main/bases
from qbittorrent.
@kikawet Since I'm using Next.js, for me I just need to do this on my next.config.js
file:
const withTM = require("next-transpile-modules")([
"@ctrl/qbittorrent",
"@ctrl/url-join",
]);
const nextConfig = {}
module.exports = withTM(nextConfig)
from qbittorrent.
Also when I try to just compile I get 8 errors from the library
$ tsc
node_modules/@ctrl/shared-torrent/dist/index.d.ts:1:23 - error TS1452: 'resolution-mode' assertions
are only supported when `moduleResolution` is `node16` or `nodenext`.
1 /// <reference types="node" resolution-mode="require"/>
~~~~
node_modules/got/dist/source/core/index.d.ts:7:8 - error TS1259: Module '"D:/Users/lopez/Programacion/Node/torrent/node_modules/@types/cacheable-request/index"' can only be default-imported using the
'allowSyntheticDefaultImports' flag
7 import CacheableRequest from 'cacheable-request';
~~~~~~~~~~~~~~~~
node_modules/@types/cacheable-request/index.d.ts:17:1
17 export = CacheableRequest;
~~~~~~~~~~~~~~~~~~~~~~~~~~
This module is declared with using 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag.
node_modules/got/dist/source/core/index.d.ts:9:13 - error TS1259: Module '"D:/Users/lopez/Programacion/Node/torrent/node_modules/@types/responselike/index"' can only be default-imported using the 'allowSyntheticDefaultImports' flag
9 import type ResponseLike from 'responselike';
~~~~~~~~~~~~
node_modules/@types/responselike/index.d.ts:11:1
11 export = ResponseLike;
~~~~~~~~~~~~~~~~~~~~~~
This module is declared with using 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag.
node_modules/got/dist/source/core/options.d.ts:5:8 - error TS1192: Module '"node:http"' has no default export.
5 import http from 'node:http';
~~~~
node_modules/got/dist/source/core/options.d.ts:6:8 - error TS1192: Module '"node:https"' has no default export.
6 import https from 'node:https';
~~~~~
node_modules/got/dist/source/core/options.d.ts:13:8 - error TS1192: Module '"D:/Users/lopez/Programacion/Node/torrent/node_modules/http2-wrapper/index"' has no default export.
13 import http2wrapper, { ClientHttp2Session } from 'http2-wrapper';
~~~~~~~~~~~~
node_modules/got/dist/source/core/options.d.ts:15:13 - error TS1259: Module '"D:/Users/lopez/Programacion/Node/torrent/node_modules/@types/cacheable-request/index"' can only be default-imported using
the 'allowSyntheticDefaultImports' flag
15 import type CacheableRequest from 'cacheable-request';
~~~~~~~~~~~~~~~~
node_modules/@types/cacheable-request/index.d.ts:17:1
17 export = CacheableRequest;
~~~~~~~~~~~~~~~~~~~~~~~~~~
This module is declared with using 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag.
node_modules/got/dist/source/core/options.d.ts:16:13 - error TS1259: Module '"D:/Users/lopez/Programacion/Node/torrent/node_modules/@types/responselike/index"' can only be default-imported using the 'allowSyntheticDefaultImports' flag
16 import type ResponseLike from 'responselike';
~~~~~~~~~~~~
node_modules/@types/responselike/index.d.ts:11:1
11 export = ResponseLike;
~~~~~~~~~~~~~~~~~~~~~~
This module is declared with using 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag.
Found 8 errors in 3 files.
Errors Files
1 node_modules/@ctrl/shared-torrent/dist/index.d.ts:1
2 node_modules/got/dist/source/core/index.d.ts:7
5 node_modules/got/dist/source/core/options.d.ts:5
from qbittorrent.
I have this problem and skipLibCheck
doesn't work.
For reference: I'm trying to use the lib on the backend on a Next.js application.
Can you please reopen the issue and maybe help us look into this? 🙏🏻
from qbittorrent.
I just noticed this lib is just ESM 😢.
I transpiled the module, but now I'm getting this warning all the time:
warn - ../node_modules/@ctrl/qbittorrent/node_modules/keyv/src/index.js
Critical dependency: the request of a dependency is an expression
Do you have any idea how to fix it?
from qbittorrent.
I just noticed this lib is just ESM 😢.
I transpiled the module, but now I'm getting this warning all the time:
...
@italodeandra how did you transpile the code?
from qbittorrent.
Even when I run ts-node with esm everything fails at some point
from qbittorrent.
I'm new to ESM and CommonJS but found this helpfull maybe someone is also good for someone else with similar issues
https://www.typescriptlang.org/docs/handbook/esm-node.html
from qbittorrent.
I created a repo with the most simple example with a new repo and just the basic info and still doesn't work
https://github.com/kikawet/example-ctrl-qbittorrent
from qbittorrent.
After reasearching in some examples I found out that this problems is only returned in versions >= 3
so using version ^2.10.0 solves everything
"dependencies": {
"@ctrl/qbittorrent": "^2.10.0"
}
from qbittorrent.
apparently other repositories that use other versions won't work either due to this same problem
should work but with the version 3 of this module it gives this error
https://github.com/scrobble-moe/server
I've been testing and found out that the problem comes from the repo in which the basic example just doesn't work so I'll just move the issue there
https://github.com/scttcper/url-join
from qbittorrent.
Related Issues (20)
- Torrent State `downloading` not working, showing `unknown` instead HOT 3
- Getting `Error: Cookie not found. Auth Failed.` after using it for a while HOT 1
- Critical dependency warning HOT 3
- Rename Folder Method HOT 1
- add torrent via url? HOT 1
- Make _normalizeTorrentData public or include raw torrent data in normalized object HOT 1
- .addMagnet torrent and then get its hash HOT 6
- `listTorrents` doesn't respect empty strings as valid inputs for `category` and `tag` HOT 2
- HTTPError: Response code 405 (Method Not Allowed) HOT 1
- Get torrent peers data HOT 1
- the expiration time is a long time in the future HOT 1
- Long-lived clients do not handle session cookie expiration HOT 2
- The `body` option must be a stream.Readable, string or Buffer
- Problem importing from `types` HOT 3
- got v12
- removeTorrent is not normalized HOT 1
- Add tag optional parameter to /torrents/info HOT 2
- 'add_trackers' and some other fields are missing in types HOT 1
- option root_folder not working on addMagnet HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qbittorrent.