You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't see any duplicates in your screenshot... please copy-paste the actual text into the issue instead of taking a screenshot of your code. That would make it easier for me to find the duplicates.
@aklinker1 The duplicates in the screenshot are highlighted text. Instead of just closing the issue right away, at least give me the chance to respond. I'm not trying to waste your time.
That said, I still would have closed it since you didn't include a reproduction like the issue template requires. Feel free to update the issue description and re-open once you have a reproduction you can share.
Read through the blog post I shared if you're not sure what a reproduction is.
You're fine. Creating a minimal reproduction might help you narrow down if it's something in your project specifically that's causing the problem, if it's how WXT uses unimport, or if it's an upstream bug of unimport.
It rightly finds 2 declarations of Foo, one class, one type. Next we call toExports, and that is what returns the duplicate identifier -
"export { Foo, Foo } from '../src/components/foo';"
If we remove the types flag from toExports, we get this:
"export { Foo } from '../src/components/foo';"
Which would be correct if it didn't strip all the other types from the output... So this makes me think it is an upstream issue with unimport, not WXT.
That said, maybe there's a better, more correct way to generate the #imports module... I'll look for one, and if not, create an issue over on unjs/unimport.
Activity
aklinker1 commentedon Feb 6, 2026
I don't see any duplicates in your screenshot... please copy-paste the actual text into the issue instead of taking a screenshot of your code. That would make it easier for me to find the duplicates.
But since you didn't include a reproduction, I'm gonna close this. Here's a good blog post about why full reproductions are necessary: https://antfu.me/posts/why-reproductions-are-required
orangejuiceext commentedon Feb 6, 2026
@aklinker1 The duplicates in the screenshot are highlighted text. Instead of just closing the issue right away, at least give me the chance to respond. I'm not trying to waste your time.
"ActivityTrail", "ProviderAdapter", "InjectAdapter", "ItemData"
In terms of reproduction, do you have a test for
export class Foo {}?aklinker1 commentedon Feb 6, 2026
Haha 🤦 blind, my bad.
That said, I still would have closed it since you didn't include a reproduction like the issue template requires. Feel free to update the issue description and re-open once you have a reproduction you can share.
Read through the blog post I shared if you're not sure what a reproduction is.
orangejuiceext commentedon Feb 6, 2026
I see now that you just depend on unimport. I'll go poking around there. Sorry for the trouble.
aklinker1 commentedon Feb 6, 2026
You're fine. Creating a minimal reproduction might help you narrow down if it's something in your project specifically that's causing the problem, if it's how WXT uses
unimport, or if it's an upstream bug ofunimport.orangejuiceext commentedon Feb 6, 2026
Quickly adding a console.log and looking at the output, it is super clear where the duplicates are coming from...
orangejuiceext commentedon Feb 6, 2026
Do you need me to do more reproduction work or is this enough now?
aklinker1 commentedon Feb 6, 2026
Give me a reproduction
orangejuiceext commentedon Feb 6, 2026
export { Foo, Foo } from '../src/components/foo';Unzip, bun install, wxt build, see above line at bottom of file.
duplicates.zip
aklinker1 commentedon Feb 9, 2026
OK, I can reproduce, it does appear to be a problem with classes. Unimport version:
Here's the relevant WXT code:
wxt/packages/wxt/src/builtin-modules/unimport.ts
Lines 85 to 102 in 08e8560
Here's the results of
unimport.getImportsIt rightly finds 2 declarations of
Foo, one class, one type. Next we calltoExports, and that is what returns the duplicate identifier -"export { Foo, Foo } from '../src/components/foo';"If we remove the types flag from
toExports, we get this:"export { Foo } from '../src/components/foo';"Which would be correct if it didn't strip all the other types from the output... So this makes me think it is an upstream issue with
unimport, not WXT.That said, maybe there's a better, more correct way to generate the
#importsmodule... I'll look for one, and if not, create an issue over onunjs/unimport.orangejuiceext commentedon Feb 9, 2026
Interestingly, in order to reproduce, I had to switch to using the src folder. Just a plain WXT init project doesn't cause this to happen.
aklinker1 commentedon Feb 9, 2026
Created an issue in unimport: unjs/unimport#498
aklinker1 commentedon Feb 9, 2026
@orangejuiceext I still get the error when I modify your reproduction to remove the src dir.
aklinker1 commentedon May 11, 2026
Unimport has fixed this, so once it's released, you can upgrade to it.
unjs/unimport#498
orangejuiceext commentedon May 20, 2026
thank you so much @aklinker1