Types are incompatible with NodeNext tsconfig
Describe the bug
The exported types don't use extensions, so they're faux esm and fail to import in modern moduleResolution settings.
Reproduction
https://arethetypeswrong.github.io/?p=wxt%400.20 (this is probably more minimal than my actual project)
Steps to reproduce
Given tsconfig.json of a wxt starter, add:
{
"compilerOptions": {
"module": "nodenext",
"moduleResolution": "nodenext",
}
}
tsc should complain that Module '"wxt"' has no exported member ...
System Info
n/a
Used Package Manager
pnpm
Validations
- [x] Read the Contributing Guidelines.
- [x] Read the docs.
- [x] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [x] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- [x] The provided reproduction is a minimal reproducible example of the bug.
You should use moduleResolution: "bundler", since it's a bundler project... but I haven't kept up with this, so I might be wrong.
Why are you trying to use nodenext?
You should use
moduleResolution: "bundler", since it's a bundler project... but I haven't kept up with this, so I might be wrong.Why are you trying to use
nodenext?
I was writing a wxt module package (lishaduck/wxt-sveltekit), wasn't bundling or nothing just native type-stripping.
I see... I'm not familiar with how NodeNext module resolution works, can you provide an actual minimal project where if I run a command, I can see the problem?
Alright, https://github.com/lishaduck/wxt-nodenext-repro, pnpm i && pnpm repro (obv. very minimal and not representative of a real use case)