Adapters throw typescript errors on import when moduleResolution
is set to "NodeNext" or "ESNext"
#5110
Labels
moduleResolution
is set to "NodeNext" or "ESNext"
#5110
Describe the bug
The
index.d.ts
file of each adapter has its export like so:kit/packages/adapter-auto/index.d.ts
Lines 3 to 4 in ec7b804
But when Typescript (4.7+) is set to have
moduleResolution
ofNodeNext
orESNext
the import statement throws a compiler error. This can be fixed by changing the export to the following:Reproduction
Importing with
NodeNext
module resolution (should see the error):https://www.typescriptlang.org/play?target=99&moduleResolution=99&ts=4.7.0-beta#code/JYWwDg9gTgLgBAQwCYLDAplAyjBNgDGcAZlBCHAOQACAzgG7oA2GAVrQPTKoZQC0CAK4wIlANxA
Same deal with
ESNext
:https://www.typescriptlang.org/play?target=99&ts=4.7.0-beta#code/JYWwDg9gTgLgBAQwCYLDAplAyjBNgDGcAZlBCHAOQACAzgG7oA2GAVrQPTKoZQC0CAK4wIlANxA
Logs
No response
System Info
Severity
serious, but I can work around it
Additional Information
As far as I can guess, there aren't backwards compatibility problems if the export is changed to:
Since the packages are already set up as ESM.
The text was updated successfully, but these errors were encountered: