Skip to content

404 (not-found.tsx) triggered when logging out #3864

Description

@tpiros

Preliminary Checks

Reproduction

https://github.com/tpiros/clerk-sample.git

Publishable key

pk_test_Y29oZXJlbnQtcG9ueS02OC5jbGVyay5hY2NvdW50cy5kZXYk

Description

In a Next.js project, when on a protected path, after signing out, if not-found.tsx is added at the root level of the project, the 404 page shows up for a moment before the user gets redirected to the the path specified via <ClerkProvider>'s afterSignOutUrl prop.

To test, throttle the network down to Fast 3G at least to see the 404 page show up. Steps to reproduce: Sign in, Navigate to /protected, Sign out.

Environment

System:
    OS: macOS 14.5
    CPU: (8) arm64 Apple M2
    Memory: 81.64 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.15.1 - /usr/local/bin/node
    npm: 10.5.1 - ~/.npm-global/bin/npm
  Browsers:
    Chrome: 127.0.6533.74
    Chrome Canary: 129.0.6629.0
    Safari: 17.5
  npmPackages:
    @clerk/nextjs: ^5.2.8 => 5.2.8 
    @types/node: ^20 => 20.14.13 
    @types/react: ^18 => 18.3.3 
    @types/react-dom: ^18 => 18.3.0 
    daisyui: ^4.12.10 => 4.12.10 
    eslint: ^8 => 8.57.0 
    eslint-config-next: 14.2.5 => 14.2.5 
    next: 14.2.5 => 14.2.5 
    postcss: ^8 => 8.4.40 
    react: ^18 => 18.3.1 
    react-dom: ^18 => 18.3.1 
    tailwindcss: ^3.4.1 => 3.4.7 
    typescript: ^5 => 5.5.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions