urgent-maroonU
Refine4w ago
5 replies
urgent-maroon

Can't seem to use Refine with Next.js + Shadcn due to `TypeError` accessing `localStorage`

Hi all,

I've been looking to get started with using Refine via the create refine-app@latest command, and wanted to do so with Next.js + Shadcn.

However, unfortunately I can't seem to start the template app that it builds out. When I do so, I get a server-side error building the pages with Next.js, with the terminal outputting that this is due to a TypeError: localStorage.getItem is not a function.

What makes this stranger is that even if I comment out all lines related to localStorage in the ThemeProvider component in theme-provider.tsx (included in the generated template app), I still get the error.

I had a look on GitHub, but couldn't seem to find any other reports of the issue occuring, hence why I thought I should check here.

Is there anything I may be missing here that might be causing the issue? Or anything I can do to fix it?

Thanks so much!
Was this page helpful?