Next 13 using useRouter
throws:
const router = useRouter()
Plasmic: Encountered error while prepass rendering: Error: Error: NextRouter was not mounted. https://nextjs.org/docs/messages/next-router-not-mounted
Next 13 using useRouter
throws:
const router = useRouter()
Plasmic: Encountered error while prepass rendering: Error: Error: NextRouter was not mounted. https://nextjs.org/docs/messages/next-router-not-mounted
This is probably thrown during pre-rendering (extractPlasmicQueryData), which tries to render a next page outside of the next context. I don’t think it used to throw though… you may need to wrap your usage of useRouter
function useMyRouter() {
try {
return useRouter();
} catch {
return {};
}
It didn’t throw in the past. Yeesh any chance we can get this on plasmic side?