Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: useSessionStorage is a client-only hook #284

Closed
reekrd opened this issue Mar 8, 2024 · 1 comment
Closed

Error: useSessionStorage is a client-only hook #284

reekrd opened this issue Mar 8, 2024 · 1 comment

Comments

@reekrd
Copy link

reekrd commented Mar 8, 2024

I'm importing useSessionStorage into a client component but get the error : useSessionStorage is a client-only hook

This happens during build thus the project can't be built.

And during development. My requested page gets a 500 error but still renders in the browser and data is set in the session storage.

Minimal reproduction can be found here: https://github.com/reekrd/min-rep-client-only-hook/

@JuventinoLVH
Copy link

This is a duplicate of #218

As said in #254 (comment) 'use client' not always run on the client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants