Skip to content

@clerk/clerk-react should have react-dom as a peer dep #2107

@hzuo

Description

@hzuo

Preliminary Checks

Reproduction / Replay Link

n/a

Publishable key

n/a

Description

Steps to reproduce:

Building an app that depends on @clerk/clerk-react with vite results in the following error:

[vite]: Rollup failed to resolve import "react-dom" from "<redacted>/web/node_modules/.pnpm/@clerk+clerk-react@4.28.0_react@18.2.0/node_modules/@clerk/clerk-react/dist/esm/utils/useCustomElementPortal.js". This is most likely unintended because it can break your application at runtime.

Expected behavior:

vite build should work.

Actual behavior:

see the above

Environment

N/A

Problem

useCustomElementPortal.tsx has import { createPortal } from 'react-dom'; but react-dom is not listed as a peer dep or a dep in @clerk/clerk-react's package.json.

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