scttcper / qbittorrent

qBittorrent api wrapper
https://qbittorrent.vercel.app
MIT License
43 stars 15 forks source link

Critical dependency warning #106

Closed italodeandra closed 2 years ago

italodeandra commented 2 years ago

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
scttcper commented 2 years ago

i think got https://github.com/sindresorhus/got uses it for caching, which we aren't using here.

scttcper commented 2 years ago

https://github.com/jaredwray/keyv/issues/45

italodeandra commented 2 years ago

Thanks for the reference, but since this lib doesn't use keyv, I removed it completely from the Next application instead.

For future reference, this is my next.config.js that also fixes the commonjs issue transpiling:

const withTM = require("next-transpile-modules")([
  "@ctrl/qbittorrent",
  "@ctrl/url-join",
]);

module.exports = withTM({
  webpack: (config, { isServer }) => {
    config.resolve.alias = {
      ...config.resolve.alias,
      keyv: false,
    };
    return config;
  },
});