genshin-kit / genshin-kit-node

原神玩家信息查询封装库 / An API wrapper for fetching player data of Genshin Impact from any servers.
https://www.npmjs.com/package/genshin-kit
Apache License 2.0
154 stars 18 forks source link

Help function _getDS({ query, body }) #26

Closed Sureiyaaa closed 3 years ago

Sureiyaaa commented 3 years ago

function _getDS({ query, body }) { ^

TypeError: Cannot destructure property 'query' of 'undefined' as it is undefined. at GenshinKit._getDS (/home/sureiya/CCG/node_modules/genshin-kit/lib/module/_getDS.js:10:19) at GenshinKit._getHttpHeaders (/home/sureiya/CCG/node_modules/genshin-kit/lib/module/_getHttpHeaders.js:12:26) at GenshinKit.request (/home/sureiya/CCG/node_modules/genshin-kit/lib/module/request.js:20:23) at GenshinKit.getSpiralAbyss (/home/sureiya/CCG/node_modules/genshin-kit/lib/index.js:167:33) at GenshinKit.getCurrentAbyss (/home/sureiya/CCG/node_modules/genshin-kit/lib/index.js:204:21) at eval (eval at exec (/home/sureiya/CCG/Commands/Owner/Evalutate.js:38:20), :1:21) at EvaluateCommand.exec (/home/sureiya/CCG/Commands/Owner/Evalutate.js:38:20) at CommandHandler.runCommand (/home/sureiya/CCG/node_modules/discord-akairo/src/struct/commands/CommandHandler.js:768:39) at CommandHandler.handleDirectCommand (/home/sureiya/CCG/node_modules/discord-akairo/src/struct/commands/CommandHandler.js:439:31) at processTicksAndRejections (node:internal/process/task_queues:96:5)

Sureiyaaa commented 3 years ago

Everytime I'm going to use getUserInfo this error pops up

dragon-fish commented 3 years ago

Hi, can you:

  1. Provide your Node.js version
  2. Can you add the --enable-source-maps attribute when you execute your program? So we can get more detailed information.

Thank you

Sureiyaaa commented 3 years ago

Node.js Version: v16.7.0

Sureiyaaa commented 3 years ago

I added the --enable-source-maps what will I do now?

Sureiyaaa commented 3 years ago

I tried to run:

this.client.genshin.getUserInfo("800151827").then(console.log, console.error)

And I get this error:

TypeError: Cannot destructure property 'query' of 'undefined' as it is undefined. at GenshinKit._getDS (/home/sureiya/CCG/node_modules/genshin-kit/lib/module/_getDS.js:10:19) at GenshinKit._getHttpHeaders (/home/sureiya/CCG/node_modules/genshin-kit/lib/module/_getHttpHeaders.js:12:26) at GenshinKit.request (/home/sureiya/CCG/node_modules/genshin-kit/lib/module/request.js:20:23) at GenshinKit.getUserInfo (/home/sureiya/CCG/node_modules/genshin-kit/lib/index.js:91:33) at eval (eval at exec (/home/sureiya/CCG/Commands/Owner/Evalutate.js:38:20), :1:21) at EvaluateCommand.exec (/home/sureiya/CCG/Commands/Owner/Evalutate.js:38:20) at CommandHandler.runCommand (/home/sureiya/CCG/node_modules/discord-akairo/src/struct/commands/CommandHandler.js:768:39) at CommandHandler.handleDirectCommand (/home/sureiya/CCG/node_modules/discord-akairo/src/struct/commands/CommandHandler.js:439:31) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async CommandHandler.handle (/home/sureiya/CCG/node_modules/discord-akairo/src/struct/commands/CommandHandler.js:379:23)

dragon-fish commented 3 years ago

https://github.com/genshin-kit/genshin-kit/blob/b8bdce6bd9a80d70201f5ced0bd1c6c7cdf66180/src/module/_getHttpHeaders.ts#L9

Bug found: os request is missing params.

We are working on this issue. But it's midnight here. We will fix it in the morning.

dragon-fish commented 3 years ago

@AlPha5130 Need your help. Can you compile the latest code for testing?

Sureiyaaa commented 3 years ago

Thank you for looking this up I'll wait for the fix 👌

AlPha5130 commented 3 years ago

There seems to be some other problems (not related to this topic though).

Sureiyaaa commented 3 years ago

ohh I hope you guys get to fix it good luck! and Thank you!

AlPha5130 commented 3 years ago

Should be fixed in commits https://github.com/genshin-kit/genshin-kit/commit/32ed851f8bcb54bfd09621ab6c2b492b43e63436 and https://github.com/genshin-kit/genshin-kit/commit/bd810f0b126ecde26913c29ee6d30310b5dffe8c .

Sureiyaaa commented 3 years ago

Alright is the genshin-kit in npm.js site updated?

dragon-fish commented 3 years ago

genshin-kit@2.4.1 now released