use-persisted-state icon indicating copy to clipboard operation
use-persisted-state copied to clipboard

SSR fails in nextjs

Open chmac opened this issue 4 years ago • 1 comments

I think the issue is that window is undefined.

I tried to find a solution here but I was getting an error about max depth updates. Some kind of circular loop. When I removed this package, it went away.

The error was:

Warning: Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.

I'm on a deadline at the moment so can't look into it further, and apologies, this is really 2 topics in 1 issue, feel free to close without comment as I realise it's not super helpful without a reproduction, etc.

chmac avatar Feb 09 '21 12:02 chmac

Thanks, I will investigate it a bit later

Akurganow avatar Feb 09 '21 12:02 Akurganow