biuuu / genshin-wish-export

Easily export the Genshin Impact wish record.
MIT License
3.77k stars 395 forks source link

Oops something failed.... #248

Closed RicoLouis24 closed 8 months ago

RicoLouis24 commented 8 months ago

image

请问这个问题如何解决? 可以帮忙修复这个问题吗? 今天抽了千織想要更新 就发生这样的问题了。。。 海砂帮忙修一修

sugtao4423 commented 8 months ago

I have same issue.

userData\log.txt ``` [AUTHKEY_TIMEOUT][2024/3/13 16:08:00]false [ERROR][2024/3/13 16:08:00]TypeError: Cannot read properties of undefined (reading 'find') [AUTHKEY_TIMEOUT][2024/3/13 16:09:55]false [ERROR][2024/3/13 16:09:55]TypeError: Cannot read properties of undefined (reading 'find') [AUTHKEY_TIMEOUT][2024/3/13 16:10:29]false [ERROR][2024/3/13 16:10:29]TypeError: Cannot read properties of undefined (reading 'find') ```
biuuu commented 8 months ago

点选项里的复制URL,看有没有内容。发给我邮箱 luna@css.moe 看看

sugtao4423 commented 8 months ago

Yes, the URL exists.

Could be an error in the getItemTypeNameMap function. The following is the content of the console.

TypeError: Cannot read properties of undefined (reading 'find')
    at D:\path\to\Genshin-Wish-Export\resources\app\dist\electron\main\main.js:26:9931
    at Array.forEach (<anonymous>)
    at dN (D:\path\to\Genshin-Wish-Export\resources\app\dist\electron\main\main.js:26:9909)
    at ng.getItemTypeNameMap (D:\path\to\Genshin-Wish-Export\resources\app\dist\electron\main\main.js:26:10015)
    at ex (D:\path\to\Genshin-Wish-Export\resources\app\dist\electron\main\main.js:101:8044)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async D:\path\to\Genshin-Wish-Export\resources\app\dist\electron\main\main.js:101:8558
    at async node:electron/js2c/browser_init:197:563
biuuu commented 8 months ago

Try v0.11.3

sugtao4423 commented 8 months ago

Thank you. But v0.11.3 had the same error.

So I inserted debug code to verify.

Diff of debug code ```diff diff --git a/src/main/gachaTypeMap.js b/src/main/gachaTypeMap.js index 2e5bfda..415baf3 100644 --- a/src/main/gachaTypeMap.js +++ b/src/main/gachaTypeMap.js @@ -1,3 +1,4 @@ +const { sendMsg } = require('./utils') const itemTypeNameMap = require('../gachaType.json') const order = ['301', '302', '200', '500', '100'] @@ -14,5 +15,7 @@ function convertItemTypeMap(mapObject) { } exports.getItemTypeNameMap = function(lang) { + sendMsg('getItemTypeNameMap', 'DEBUG - func') + sendMsg(lang, 'DEBUG - lang') return convertItemTypeMap(itemTypeNameMap[lang]) } \ No newline at end of file diff --git a/src/main/getData.js b/src/main/getData.js index 9d9ad25..5f89a62 100644 --- a/src/main/getData.js +++ b/src/main/getData.js @@ -404,6 +404,7 @@ const fetchData = async (urlOverride) => { sendMsg(message) throw new Error(message) } + sendMsg(url, 'DEBUG - url') const searchParams = getQuerystring(url) if (!searchParams) { const message = text.url.incorrect ```
Debug log The URL is processed. ``` [DEBUG - url][2024/3/13 17:43:49]https://hk4e-api-os.hoyoverse.com/gacha_info/api/getGachaLog?{SOME_PARAMS}&lang=ja&{SOME_PARAMS_INCLUDES_AUTHKEY} [AUTHKEY_TIMEOUT][2024/3/13 17:43:50]false [DEBUG - func][2024/3/13 17:43:50]getItemTypeNameMap [DEBUG - lang][2024/3/13 17:43:50]ja [ERROR][2024/3/13 17:43:50]TypeError: Cannot read properties of undefined (reading 'find') ```

It seems that the lang format has changed and I need to make sure for all languages.

sugtao4423 commented 8 months ago

I checked all of them. It seems to have changed to a string before the delimiter "-" except for Chinese.

prev now
en-us en
fr-fr fr
de-de de
es-es es
pt-pt pt
ru-ru ru
ja-jp ja
ko-kr ko
th-th th
vi-vn vi
id-id id
zh-cn zh-cn
zh-tw zh-tw
tr-tr tr
it-it it
biuuu commented 8 months ago

@sugtao4423 https://hk4e-api-os.hoyoverse.com/gacha_info/api/getGachaLog?{SOME_PARAMS}&lang=ja&{SOME_PARAMS_INCLUDES_AUTHKEY} When you replace “ja” with “ja-jp,” does the request still return data correctly?

sugtao4423 commented 8 months ago

@biuuu Thank you for the merge! Yes, it has been confirmed. At least ja-jp and en-us were returned correctly.

RicoLouis24 commented 8 months ago

点选项里的复制URL,看有没有内容。发给我邮箱 luna@css.moe 看看

可以了最新的版本 修好了 0.11.4 可以了