oeyoews / react-music

🎶 使用 NextJS14 构建的在线音乐播放器
https://music.oeyoews.top
2 stars 0 forks source link

searchparams bug #40

Closed oeyoews closed 9 months ago

oeyoews commented 9 months ago

production environment song?id=xx not work in my case. seems like not searchparams.id not receive any value.

oeyoews commented 9 months ago

local build or dev is normal, bug online is not

oeyoews commented 9 months ago

果然是ppr 的问题, searchparams 的参数在server 没有任何参数, 直接就return 预渲染了, client 上即使接收到params 也不会更新渲染. 这里是使用ssg, 导致的, 解决办法就是不用ssg(generatestaticparams)

oeyoews commented 9 months ago

ps: 使用了searchparms 就不需要生成动态路由了在ssg中 可以用, 主要还是ppr导致的问题

oeyoews commented 9 months ago

本地之所以没有报错, 是因为本地自动传递了cookie on local