clerk / javascript

Official Javascript repository for Clerk authentication
https://clerk.com
MIT License
954 stars 210 forks source link

NextJS App Router Can't Redirect from OrgList #2873

Open caelinsutch opened 4 months ago

caelinsutch commented 4 months ago

Preliminary Checks

Reproduction / Replay Link

https://jam.dev/c/91fb6b01-01e8-4757-9b83-cf9524331ee0

Publishable key

pk_test_Y2F1c2FsLXRlcm1pdGUtMS5jbGVyay5hY2NvdW50cy5kZXYk

Description

Steps to reproduce:

  1. Use OrgList in NextJS13 with afterCreateOrganizationUrl and afterSelectOrganizationUrl set
  2. Click on an organization
  3. Goes gray and console throws an error

Expected behavior:

Should be a redirect

Environment

System: node_modules/ public/ src/ styled-system/
    OS: macOS 14.3.1
    CPU: (10) arm64 Apple M1 Max
    Memory: 476.75 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.9.0 - ~/.nvm/versions/node/v20.9.0/bin/node
    Yarn: 4.1.0 - ~/.nvm/versions/node/v20.9.0/bin/yarn
    npm: 10.1.0 - ~/.nvm/versions/node/v20.9.0/bin/npm
  Browsers:
    Chrome: 121.0.6167.184
    Safari: 17.3.1
  npmPackages:
    @clerk/nextjs: ^4.29.7 => 4.29.7
    @hookform/resolvers: ^3.3.4 => 3.3.4
    @pandacss/dev: ^0.31.0 => 0.31.0
    @prisma/client: ^5.6.0 => 5.9.1
    @tanstack/react-query: ^4.32.6 => 4.36.1
    @tanstack/react-table: ^8.12.0 => 8.12.0
    @tiptap/react: ^2.2.4 => 2.2.4
    @trpc/react-query: 10.45.1 => 10.45.1
    @types/node: ^18.17.0 => 18.19.17
    @types/react: ^18.2.37 => 18.2.55
    @types/react-dom: ^18.2.15 => 18.2.19
    @typescript-eslint/eslint-plugin: ^6.11.0 => 6.21.0
    @typescript-eslint/parser: ^6.11.0 => 6.21.0
    lucide-react: ^0.336.0 => 0.336.0
    next: ^14.0.4 => 14.1.0
    prisma: ^5.6.0 => 5.9.1
    react-dom: 18.2.0 => 18.2.0
    react-hook-form: ^7.50.1 => 7.50.1
    sonner: ^1.4.2 => 1.4.2
    use-debounce: ^10.0.0 => 10.0.0
    zustand: ^4.5.1 => 4.5.1
jescalan commented 3 months ago

Hey @caelinsutch!

I just put together an app that only renders the component as you described - this is the entirety of the code:

<OrganizationList
      afterCreateOrganizationUrl="/"
      afterSelectOrganizationUrl="/"
    />

When I tested it, both of the redirects worked and I didn't get an error. I think in this case, we'd need a minimal reproduction from your side of the issue so that we can figure out what's going on.