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

the routing=virtual in <SignIn /> component removed is A BREAKING CHANGE which casue our app build failed #5055

Closed
4 tasks done
arvinxx opened this issue Jan 31, 2025 · 3 comments
Labels
needs-triage A ticket that needs to be triaged by a team member

Comments

@arvinxx
Copy link

arvinxx commented Jan 31, 2025

Preliminary Checks

Reproduction

code below:

import { ClerkLoaded, ClerkLoading, SignIn } from '@clerk/nextjs';
import { memo, useState } from 'react';

import Notification from '@/components/Notification';
import Loading from '@/features/User/LoginNotification/Loading';

const LoginNotificationModal = memo<LoginNotificationModalProps>(({ variant }) => {
  const [show, setShow] = useState(true);
  const isAtTop = variant === 'top';

  return (
    <Notification
      onCancel={() => setShow(false)}
      show={show}
    >
      <ClerkLoading>
        <Loading atTop={isAtTop} />
      </ClerkLoading>
      <ClerkLoaded>
        <SignIn  routing={'virtual'} />
      </ClerkLoaded>
    </Notification>
  );
});

export default LoginNotificationModal;

Publishable key

none

Description

I notice #4977 this pr remove the virtual props, which cause our product build failed.

I really don't the routing=virtual props is an internal value, you have just write it on the document but just remove it within a patch version. It's horrible.

Image Image

Here is our usage with this routing=virtual, if you just remove this props, how can we achieve the same feature without it?

please consider to turn back this props, or remove it in the next Major version and give out a migration guide.

Steps to reproduce:

Expected behavior:

not build error

Actual behavior:

cause an error of ts error:

src/features/User/LoginNotification/Notification.tsx:77:51 - error TS2322: Type '"virtual"' is not assignable to type '"path" | "hash" | undefined'.

77         <SignIn appearance={{ elements: styles }} routing={'virtual'} />
                                                     ~~~~~~~

  node_modules/.pnpm/@[email protected]/node_modules/@clerk/types/dist/index.d.ts:4824:5
    4824     routing?: Extract<RoutingStrategy, 'path'>;
             ~~~~~~~
    The expected type comes from property 'routing' which is declared here on type 'IntrinsicAttributes & Without<WithClerkProp<SignInProps & FallbackProp>, "clerk">'

Environment

System:
    OS: macOS 15.2
    CPU: (10) arm64 Apple M1 Max
    Memory: 73.48 MB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.11.0 - /usr/local/bin/node
    Yarn: 1.22.19 - ~/Library/pnpm/yarn
    npm: 9.2.0 - ~/Library/pnpm/npm
    pnpm: 9.15.4 - ~/Library/pnpm/pnpm
    bun: 1.0.26 - ~/Library/pnpm/bun
  Browsers:
    Brave Browser: 127.1.68.128
    Chrome: 132.0.6834.111
    Chrome Canary: 134.0.6983.0
    Safari: 18.2
@arvinxx arvinxx added the needs-triage A ticket that needs to be triaged by a team member label Jan 31, 2025
@arvinxx arvinxx closed this as not planned Won't fix, can't repro, duplicate, stale Jan 31, 2025
@arvinxx arvinxx reopened this Jan 31, 2025
@arvinxx
Copy link
Author

arvinxx commented Jan 31, 2025

now I have overrides the @clerk/types to 4.44.1, hope you can revert the change or give a migration way to do it:

{
  "dependencies": {
    "@clerk/nextjs": "6.10.2",
  },
  "pnpm": {
    "overrides": {
      "@clerk/types": "4.44.1",
    }
  },
  "overrides": {
    "@clerk/types": "4.44.1"
  }
}

@alexcarpenter
Copy link
Member

@arvinxx the change has been reverted. Apologies for the inconvenience. Virtual routing uses hash under the hood, so we wanted to make sure it was obvious that was happening. We've marked as deprecated and will wait to remove until the next major release.

#5057

@arvinxx
Copy link
Author

arvinxx commented Feb 1, 2025

@alexcarpenter hi, thanks for the quick response. But in my usage show above, what's the correct migration way to the hash routing?

we don't want to have a login or signup hash url explicitly, so we use the virtual routing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage A ticket that needs to be triaged by a team member
Projects
None yet
Development

No branches or pull requests

2 participants