WAServiceMainContext.js:2 Uncaught FrameworkError
Cannot read property 'song' of undefined
TypeError: Cannot read property 'song' of undefined
at Br.onLoad (http://127.0.0.1:19738/appservice-hotreload/pages/songDetail/songDetail.js?=1;:34:35)
at l.<anonymous> (http://127.0.0.1:19738/appservice/__dev__/WASubContext.js?t=wechat&s=1657708501318&v=2.19.4:2:2215235)
at http://127.0.0.1:19738/appservice/__dev__/WASubContext.js?t=wechat&s=1657708501318&v=2.19.4:2:2169442
at D (http://127.0.0.1:19738/appservice/__dev__/WASubContext.js?t=wechat&s=1657708501318&v=2.19.4:2:2085826)
at http://127.0.0.1:19738/appservice/__dev__/WASubContext.js?t=wechat&s=1657708501318&v=2.19.4:2:2169255
at Array.forEach (<anonymous>)
at http://127.0.0.1:19738/appservice/__dev__/WASubContext.js?t=wechat&s=1657708501318&v=2.19.4:2:2169239
at Array.forEach (<anonymous>)
at http://127.0.0.1:19738/appservice/__dev__/WASubContext.js?t=wechat&s=1657708501318&v=2.19.4:2:2169168
at http://127.0.0.1:19738/appservice/__dev__/WASubContext.js?t=wechat&s=1657708501318&v=2.19.4:2:2169517(env: Windows,mp,1.06.2206090; lib: 2.19.4)
看到这个错误,一般是JSON.parse编译错误,主要原因是JSON.parse将json对象反编译成js对象
在微信小程序中,使用url的query形式传参,传参的长度有限制,长度太长被截取了,所以报错