one
one copied to clipboard
SSR not working with some libraries
I get the following error in certain libraries, such as @tanstack/react-query. I'm assuming it has something to do with the way the bundler adds react. Perhaps react is out of scope or an issue with the way it does SSR.
Error in handleSSR: TypeError: Cannot read properties of null (reading 'useEffect')
This error happens in ssr and ssg mode, but does not happen in spa mode. I'm wondering if the "use client" decorator is ignored.
Here's a related issue to this.
https://github.com/TanStack/query/issues/5419