We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在electron应用中作为依赖引入,调用match接口,开发环境可以正常使用,但是打包后运行exe返回为空,这是函数(修改了入口函数的入参构造,其余均未做修改) static async matchMore(_event: any, query: any) { try { log.info('match_song_query:', query); const q = PlayerUtil.hanldeQuery(query) const { id,data, openFlac = true, musicLevel, followOrder } = q const res = await match(id, JSON.parse(JSON.stringify(data)), ['pyncmd', 'kuwo', 'qq'], openFlac, musicLevel, followOrder); log.info('match_res:', res); return res; } catch (error) { console.error(error); } }
static async matchMore(_event: any, query: any) { try { log.info('match_song_query:', query); const q = PlayerUtil.hanldeQuery(query) const { id,data, openFlac = true, musicLevel, followOrder } = q const res = await match(id, JSON.parse(JSON.stringify(data)), ['pyncmd', 'kuwo', 'qq'], openFlac, musicLevel, followOrder); log.info('match_res:', res); return res; } catch (error) { console.error(error); } }
在electron打包后的生产环境正确返回匹配内容
生产环境返回空值undefined
No response
依赖库使用,match()
return undefined
lastest
win11
The text was updated successfully, but these errors were encountered:
命令行运行exe依赖库函数同样生效,但是当直接双击exe运行时,依赖函数却无法使用
Sorry, something went wrong.
问题已经解决了,问题隐藏地太深,经过不断地调试,原因是pino的日志输出流在打包后的生产环境下会顶替掉函数返回的内容导致返回undefined 由于我不太清楚pino底层的运作方式,所以不清楚为何会出现这样的情况 问题代码位于serve/ src/provider/match.js function match() ... const { id: audioId, name } = audioInfo; const { url } = audioData; logger.debug({ audioInfo, audioData }, 'The data to replace:'); logger.info( { audioId, songName: name, url, }, Replaced: [${audioId}] ${name} ); return audioData;
const { id: audioId, name } = audioInfo; const { url } = audioData; logger.debug({ audioInfo, audioData }, 'The data to replace:'); logger.info( { audioId, songName: name, url, },
); return audioData;
No branches or pull requests
Bug 描述
在electron应用中作为依赖引入,调用match接口,开发环境可以正常使用,但是打包后运行exe返回为空,这是函数(修改了入口函数的入参构造,其余均未做修改)
static async matchMore(_event: any, query: any) { try { log.info('match_song_query:', query); const q = PlayerUtil.hanldeQuery(query) const { id,data, openFlac = true, musicLevel, followOrder } = q const res = await match(id, JSON.parse(JSON.stringify(data)), ['pyncmd', 'kuwo', 'qq'], openFlac, musicLevel, followOrder); log.info('match_res:', res); return res; } catch (error) { console.error(error); } }
预期行为
在electron打包后的生产环境正确返回匹配内容
实际行为
生产环境返回空值undefined
复现步骤
No response
启动命令及环境变量
依赖库使用,match()
日志内容
return undefined
网易云音乐歌曲链接
No response
网易云音乐版本号
lastest
操作系统
win11
其他信息
No response
问题排查
The text was updated successfully, but these errors were encountered: