Skip to content

Popper type definitions errors #472

Closed
@hollg

Description

@hollg

Bug report

Current Behavior

When I run tsc --no-emit in my project using @radix-ui/react-tooltip, I get the following errors:

node_modules/@radix-ui/react-popper/dist/index.d.ts:3:10 - error TS2440: Import declaration conflicts with local declaration of 'Arrow'.

3 import { Arrow } from "@radix-ui/react-arrow";
           ~~~~~

node_modules/@radix-ui/react-popper/dist/index.d.ts:17:6 - error TS2456: Type alias 'PopperArrowOwnProps' circularly references itself.

17 type PopperArrowOwnProps = Merge<Polymorphic.OwnProps<typeof Arrow>, {
        ~~~~~~~~~~~~~~~~~~~

node_modules/@radix-ui/react-popper/dist/index.d.ts:20:29 - error TS4109: Type arguments for 'ForwardRefComponent' circularly reference themselves.

20 type PopperArrowPrimitive = Polymorphic.ForwardRefComponent<Polymorphic.IntrinsicElement<typeof Arrow>, PopperArrowOwnProps>;
                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expected behavior

No such errors to occur.

Reproducible example

You can run yarn validate:types in the feat-tooltip-component branch of this repository: https://github.com/Atom-Learning/components

Suggested solution

This error is resolved by replacing import { Arrow } from "@radix-ui/react-arrow"; at line 3of index.d.ts with import { Arrow as AnythingElse } from "@radix-ui/react-arrow"; and updating references to the import on lines 17 and 19.

Your environment

Software Name(s) Version
Radix Package(s) @radix-ui/react-tooltip 0.0.7
React n/a 17.0.1
Browser n/a n/a
Assistive tech n/a n/a
Node n/a v14.4.0
npm/yarn yarn 1.22.5
Operating System MacOS Big Sur 11.1

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