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

useUser(), <SignInButton> component, and useClerk() are inconsistent #1673

Closed
6 of 21 tasks
leo-paz opened this issue Sep 1, 2023 · 8 comments
Closed
6 of 21 tasks
Labels
linear Created by Linear-GitHub Sync needs-reproduction Awaiting a minimal reproduction

Comments

@leo-paz
Copy link

leo-paz commented Sep 1, 2023

Brief Summary of the Issue

useUser().isSignedIn returns false yet useClerk().user has the correct user details. I also have had so much trouble using and i'm assuming this is related. I get a next hydration error every time I try to use the built in component.

Minimal Reproduction or Replay

image
image

Browser/OS

_If applicable e.g. Chromium 115.0.5790.114, Node 18.10.0

Package + Version

  • @clerk/clerk-js
  • @clerk/clerk-react
  • @clerk/nextjs 4.23.3
  • @clerk/remix
  • @clerk/types
  • @clerk/themes 1.7.5
  • @clerk/localizations
  • @clerk/clerk-expo
  • @clerk/backend
  • @clerk/clerk-sdk-node
  • @clerk/shared
  • @clerk/fastify
  • @clerk/chrome-extension
  • gatsby-plugin-clerk
  • build/tooling/chore
  • other:
@panteliselef
Copy link
Member

Hello @leo-paz Could u provide us with a repo or something like a CodeSandbox ? The above code seems to work as expected when I moved it to an existing project.

Also about issue with <SignInButton/> what seems to be the problem ?

@panteliselef panteliselef added the needs-reproduction Awaiting a minimal reproduction label Sep 1, 2023
@leo-paz
Copy link
Author

leo-paz commented Sep 1, 2023

@panteliselef Thanks for the prompt reply. So I tried branching off the clerk-next-app-router-starter project after I tried copying over how the built in components were used in layout.tsx I get this error locally:

Error: Clerk: auth() was called but it looks like you aren't using `authMiddleware` in your middleware file. 
Please use `authMiddleware` and make sure your middleware matcher is configured correctly and it matches this route or page. 
See https://clerk.com/docs/quickstarts/get-started-with-nextjs

my middleware.ts is at the same level as /app and I only see it after trying to use these components in the layout.tsx.

I'm not sure what I'm doing wrong :/ heres a code snippet
image
image

@leo-paz
Copy link
Author

leo-paz commented Sep 2, 2023

@panteliselef i found a related thread and have attached a link in this comment that reproduces the issue: clerk/clerk-next-app-router-starter#2 (comment)

@kayog123
Copy link

kayog123 commented Sep 13, 2023

I have the same issue. The useUser hook is inconsistent.

@clerk-cookie
Copy link
Collaborator

Hello 👋

We currently close issues after 40 days of inactivity. It's been 30 days since the last update here. If we missed this issue, please reply here. Otherwise, we'll close this issue in 10 days.

As a friendly reminder: The best way to see an issue fixed is to open a pull request. If you're not sure how to do that, please check out our contributing guide.

Thanks for being a part of the Clerk community! 🙏

@tolgaouz
Copy link

I also had this problem with my next 13 setup. This issue saved us from migrating off of Clerk. Thank you @leo-paz

@clerk-cookie
Copy link
Collaborator

Hello 👋

We currently close issues after 40 days of inactivity. It's been 30 days since the last update here. If we missed this issue, please reply here. Otherwise, we'll close this issue in 10 days.

As a friendly reminder: The best way to see an issue fixed is to open a pull request. If you're not sure how to do that, please check out our contributing guide.

Thanks for being a part of the Clerk community! 🙏

@jescalan jescalan added the linear Created by Linear-GitHub Sync label Nov 16, 2023
@jescalan
Copy link
Contributor

Inactive for 40+ days, reproduction not provided, closing this one. Please feel free to open a new issue if anyone else runs into similar issues!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linear Created by Linear-GitHub Sync needs-reproduction Awaiting a minimal reproduction
Projects
None yet
Development

No branches or pull requests

6 participants