Reach-ui: Tooltip types broken

Created on 26 Aug 2020  路  6Comments  路  Source: reach/reach-ui

馃悰 Bug report

Current Behavior

The components Tooltip and TooltipPopup are of type any

Expected behavior

They should be typed as a component

Reproducible example

Suggested solution(s)

The .d.ts file contains import("../../utils/src"), this folder doesn't exist. Changing to import("../../utils") fixed the issue locally.

Additional context

Your environment

| Software | Name(s) | Version |
| ---------------- | ------- | ------- |
| Reach Package | tooltip | 0.11.0 |
| React | | ^16.13.1 |
| Browser | n/a | |
| Assistive tech | n/a | |
| Node | | 14.8.0 |
| npm/yarn | yarn | 1.22.4 |
| Operating System | ubuntu | 20.04 |

Investigation Bug

All 6 comments

Wonder if it's because of the ts-node --transpile-only added in https://github.com/reach/reach-ui/pull/654 ...

cc @chancestrickland

For @reach/accordion version 0.10.4, @reach/utils is imported as import("@reach/utils") in the .d.ts files.

For @reach/tooltip version 0.11.0, @reach/utils is imported as import("../../utils/src") in the .d.ts files.

TypeScript is complaining that it can't find the declaration for the latter, which means that Tooltip has type any since it is defined in terms of ForwardRefExoticComponentWithAs.

I found the bug I introduced with the build overhaul. Hoping to have a patch either this afternoon or tomorrow!

Should be fixed in 0.11.2. Let me know if there are any issues here!

a8ef829 was the one. I simplified the build from v0.10 and in the process consolidated the TS configs, and I forgot to make sure path aliases didn't make it into the build config. Build still passed locally and in CI because the ../../src path resolved, but not so in the published packages. Would love to update CI to catch that, but I didn't have time to explore too much. Just wanted to get a fix out quickly!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ryanflorence picture ryanflorence  路  4Comments

loicplaire picture loicplaire  路  3Comments

CodingDive picture CodingDive  路  4Comments

raunofreiberg picture raunofreiberg  路  3Comments

lawnchamp picture lawnchamp  路  3Comments