Skip to content

brettabamonte/Clerk-Minimal_Reproduction-SignIn_Component

Repository files navigation

Minimal Reproduction - Component - Clerk and NextJS

I ran into a issue when using the and components inside a NextJS project using App Router.

If you add the apperance prop to the and a user click the to sign out the component will not render until you refresh the screen.

If you refresh the screen at any point between signing in and signing out the component will appear. But, if the broswer does not refresh between signing in and signing out. The component will not render.

Steps to Reproduce

  1. Clone NextJS Repo
  2. Run ‘npm install next@14.0.0’
  3. Create application on clerk. Copy publishable key and secret key
  4. Rename ‘env.template’ to ‘env.local’.
  5. Paste keys from Clerk into file
  6. Run ‘npm run dev’
  7. Create account on site
  8. In ‘@/app/layout.tsx’ add the following code underneath the tag on line 89. Code Snippet #1
  9. Add the following appearance prop to the component in ‘@/app/sign-in/[[…sign-in]]/page.tsx’ Code Snippet #2
  10. Control + C in Terminal to stop running the development server.
  11. Run ‘npm run dev’
  12. Click ‘View Demo’
  13. Sign In
  14. Click ‘Sign Out’ button in top-right corner of screen
  15. Blank screen should appear (NOTE: If the component renders repeat steps 13 and 14. The component should does not render again).

NOTE: If you refresh the page the component will render.

  1. Remove appearance prop from component in ‘@/app/sign-in/[[…sign-in]]/page.tsx’ Code Snippet #3
  2. Save file and repeat steps 13 and 14. The component will render.

Further Tests

I found that if the browser refreshes at any point before clicking the ‘Sign Out’ button then the component with appearance props will render.

Steps To Re-Create:

  1. Add an appearance prop back to the component Code Snippet #4
  2. Repeat step 13 from steps above.
  3. Refresh browser
  4. Click ‘Sign Out’ button in top-right corner of screen The component will render with the appropriate appearance props.

Other Notes

I downgraded Next to version 13.5.6 and repeated the steps to reproduce above. The same outcome occurred. I also downgraded Clerk to 4.21.8, repeated the steps above and got the same outcome.

About

Minimal reproduction for Clerk <SignIn /> Component Issue in NextJS. <SignIn /> components that have the appearance property are not rendering when a <SignOutButton> is clicked.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published