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

0.4.6 not exporting components correctly #3733

Open
FlorianBurgevin opened this issue Apr 23, 2024 · 10 comments
Open

0.4.6 not exporting components correctly #3733

FlorianBurgevin opened this issue Apr 23, 2024 · 10 comments

Comments

@FlorianBurgevin
Copy link

FlorianBurgevin commented Apr 23, 2024

Current behavior

Hello.
I am importing some components from the library.

import { usePopoverStore, Popover, PopoverDisclosure } from '@ariakit/react';

But when i update to last version 0.4.6, components are not exported anymore.

Steps to reproduce the bug

#3733 (comment)

Expected behavior

I should get my components

Workaround

Upgrade to TypeScript v5

Possible solutions

No response

@diegohaz
Copy link
Member

Hi @FlorianBurgevin! Could you please provide a repro? It's working well here: https://stackblitz.com/edit/qh8kyv?file=package.json,popover-selection%2Findex.tsx&theme=dark

@FlorianBurgevin
Copy link
Author

FlorianBurgevin commented Apr 24, 2024

Hi @diegohaz

Hum that's weird. I see the correct export in my node modules but my project seems not to resolve the following export

export * from "./popover.ts";

It doesn't find the declaration to go. But that's ok in your example

In your project, it resolves esm so it's ok, but i'm resolving cjs. And in previous version, the index.d.ts in CJS has those lines: export * from "./popover.js";

@Anthonytorrero
Copy link

I am also encountering this problem with Combobox. I had to revert back to 0.4.5 because updating to 0.4.6 does not export

@nicosammito
Copy link

I have a similar issue. When I am importing directly from "@ariakit/react/select" it recognizes the import but the type definition is gone. And if I directly import nothing works.

Bildschirmfoto 2024-05-13 um 22 27 44

@nicosammito
Copy link

When I switch back to 0.4.5 everything works normally

Bildschirmfoto 2024-05-13 um 22 32 25

@diegohaz

@diegohaz
Copy link
Member

diegohaz commented May 13, 2024

I'm unable to replicate this issue myself, so I'd appreciate a StackBlitz, CodeSandbox, or even a repository link that demonstrates the problem.

It's also not clear whether the components aren't being exported at all, as the initial report implies, or if it's solely a TypeScript compiler issue. In other words, if you ignore the TypeScript errors, are the components still visible on the page?

If it's only a TypeScript problem, I'd recommend trying the compilerOptions.allowImportingTsExtensions option in your tsconfig.json file.

It would also help if you could specify whether you're using ESM or CJS (in which case I highly recommend you to migrate to ESM as soon as possible).

@FlorianBurgevin
Copy link
Author

FlorianBurgevin commented May 14, 2024

Hi @diegohaz !

Here is a reproductible stackblitz: https://stackblitz.com/edit/webpack-5-react-starter-khsjx9?file=src%2Fpopover-selection%2Findex.tsx

I reused your example.

As you can see, with 0.4.6, there is TS errors in the Console saying that elements are not exported.

@diegohaz
Copy link
Member

@FlorianBurgevin, thanks for providing the reproduction.

It appears to be an issue with the TypeScript v4 compiler.

I'll look into what we can do on our end, but please note that TypeScript v5 was released over a year ago. If it's possible for you to upgrade, I'd strongly suggest doing so.

@nicosammito
Copy link

@FlorianBurgevin, thanks for providing the reproduction.

It appears to be an issue with the TypeScript v4 compiler.

I'll look into what we can do on our end, but please note that TypeScript v5 was released over a year ago. If it's possible for you to upgrade, I'd strongly suggest doing so.

Oh jeh that was actually my problem, thanks 👍🏻

@FlorianBurgevin
Copy link
Author

Ok thanks @diegohaz

I'll try to upgrade to TypeScript 5 waiting for a fix :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants