i have big problem with my project, when i’m uploading riot api to my file
import { RiotAPI, RiotAPITypes, PlatformId } from "@fightmegg/riot-api";
and trying to use it, exactly like on github, i get insta error in console, which shows that i don’t have modules : tls, net, dns. I tried to install them and import, but it was still error.
I’m trying to find user, by world and nickname so i’m using this code
const config: RiotAPITypes.Config = {
debug: false,
cache: {
cacheType: "local", // local or ioredis
client: `localhost:3000/settings`, // leave null if client is local
ttls: {
byMethod: {
[RiotAPITypes.METHOD_KEY.SUMMONER.GET_BY_SUMMONER_NAME]: 5000, // ms
},
},
},
};
const rAPI = new RiotAPI("RGAPI-37aee947-8e88-4f4c-b420-f7828d58e815", config);
(async () => {
const rAPI = new RiotAPI("RGAPI-37aee947-8e88-4f4c-b420-f7828d58e815");
const summoner = await rAPI.summoner.getBySummonerName({
region: PlatformId.EUW1,
summonerName: "Demos Kratos",
});
})();
and problem which i see looks like this :
Module not found: Can’t resolve ‘net’
Import trace for requested module:
./node_modules/ioredis/built/cluster/index.js
./node_modules/ioredis/built/index.js
./node_modules/@fightmegg/riot-api/dist/esm/cache.js
./node_modules/@fightmegg/riot-api/dist/esm/index.js
./src/pages/settings/index.tsx
Module not found: Can’t resolve ‘tls’
Import trace for requested module:
./node_modules/ioredis/built/index.js
./node_modules/@fightmegg/riot-api/dist/esm/cache.js
./node_modules/@fightmegg/riot-api/dist/esm/index.js
./src/pages/settings/index.tsx
Module not found: Can’t resolve ‘dns’
Import trace for requested module:
./node_modules/ioredis/built/cluster/index.js
./node_modules/ioredis/built/index.js
./node_modules/@fightmegg/riot-api/dist/esm/cache.js
./node_modules/@fightmegg/riot-api/dist/esm/index.js
./src/pages/settings/index.tsx