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

hanko-elements seems incompatible with @types/[email protected] #2053

Open
2 tasks done
willyfromtheblock opened this issue Feb 15, 2025 · 2 comments · May be fixed by #2067
Open
2 tasks done

hanko-elements seems incompatible with @types/[email protected] #2053

willyfromtheblock opened this issue Feb 15, 2025 · 2 comments · May be fixed by #2067
Assignees
Labels
bug Something isn't working priority high

Comments

@willyfromtheblock
Copy link

willyfromtheblock commented Feb 15, 2025

Checklist

  • I could not find a solution in the existing issues or docs.
  • I agree to follow this project's Code of Conduct.

Describe the bug

Hi,

I'm using components/HankoAuth.tsx for nextjs, more or less straight from your docs.

Upgrading @types/react to ^19.0.0 gives me an

Property 'hanko-auth' does not exist on type 'JSX.IntrinsicElements'.ts(2339)

error.

Same thing happens for <hanko-profile />.


I have googled around a bit and this might be related to the leading small letter of <hanko-auth />?

    "@types/react": "^18.3.3",

still works

Reproducing the bug

upgrade @types/react to ^19.0.0

Logs

Configuration

Hanko Version

"@teamhanko/hanko-elements": "^1.4.0",

OS Hanko Backend

None

OS Version Hanko Backend

No response

OS

None

OS Version

No response

Browser Version

No response

Environment

None

Additional Context

No response

@willyfromtheblock willyfromtheblock added the bug Something isn't working label Feb 15, 2025
@github-project-automation github-project-automation bot moved this to 🆕 New in Hanko Feb 15, 2025
@FilippTrigub
Copy link

FilippTrigub commented Feb 27, 2025

And I was thinking, I'm the only one with this issue...any fix beyond downgrading?

@FreddyDevelop
Copy link
Contributor

Staring from React 19 the JSX namespace is not longer global but react scoped. As a workaround you can add a new file (e.g. "custom.d.ts") with:

import { HankoAuthElementProps, HankoProfileElementProps, HankoEventsElementProps } from "@teamhanko/hanko-elements";

declare module "react" {
  namespace JSX {
    interface IntrinsicElements {
        "hanko-auth": HankoAuthElementProps;
        "hanko-login": HankoAuthElementProps;
        "hanko-registration": HankoAuthElementProps;
        "hanko-profile": HankoProfileElementProps;
        "hanko-events": HankoEventsElementProps;
    }
  }
}

More information about it can be found here

@FreddyDevelop FreddyDevelop linked a pull request Feb 28, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority high
Projects
Status: 🆕 New
Development

Successfully merging a pull request may close this issue.

5 participants