Giter Club home page Giter Club logo

Comments (11)

scttcper avatar scttcper commented on September 27, 2024 1

you will probably want to enable skipLibCheck, most of the default tsconfigs do https://github.com/tsconfig/bases/tree/main/bases

from qbittorrent.

italodeandra avatar italodeandra commented on September 27, 2024 1

@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.

kikawet avatar kikawet commented on September 27, 2024

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.

italodeandra avatar italodeandra commented on September 27, 2024

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.

italodeandra avatar italodeandra commented on September 27, 2024

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.

kikawet avatar kikawet commented on September 27, 2024

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.

kikawet avatar kikawet commented on September 27, 2024

Even when I run ts-node with esm everything fails at some point

from qbittorrent.

kikawet avatar kikawet commented on September 27, 2024

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.

kikawet avatar kikawet commented on September 27, 2024

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.

kikawet avatar kikawet commented on September 27, 2024

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.

kikawet avatar kikawet commented on September 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.