-
Notifications
You must be signed in to change notification settings - Fork 85
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Environment
- Unimport: 5.6.0
- Bun: 1.3.8
- Node: 24.7.0
Reproduction
https://github.com/aklinker1/unimport-class-issue-reproduction
Run it via:
bun install
bun index.ts
# or for node versions that support type-stripping
npm install
node index.tsBoth node and bun behave the same.
Describe the bug
The script is very simple: scan a directory and export all it's values and types.
However, this code produces an invalid export:
export { Foo, Foo } from '/path/to/reproduction/src/Foo';It's trying to import the class value and type separately.
Is this intentional? Does the code need to filter the imports list before passing it into toExports or should toExports handle this case?
Additional context
Originally reported in WXT: wxt-dev/wxt#2064 (comment)
Logs
Imports: [
{
name: 'Foo',
as: 'Foo',
from: '/path/to/reproduction/utils/Foo.ts'
},
{
name: 'Foo',
as: 'Foo',
from: '/path/to/reproduction/utils/Foo.ts',
type: true,
declarationType: 'class'
}
]
Exports:
export { Foo, Foo } from '/path/to/reproduction/utils/Foo';Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working