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
Starting in v5.11.0, it seems like the "esModuleInterop" flag is required to get a TypeScript build passing for a project referencing undici. It worked just fine in 5.10.0, and I believe the change to the types files occurred in the following PR by @arontsang, but I'm not sure if it was intentional: #1338
node_modules/undici/types/client.d.ts:5:8 - error TS1259: Module '"/undiciBug/node_modules/undici/types/connector"' can only be default-imported using the 'esModuleInterop' flag
5 import buildConnector, {connector} from "./connector";
~~~~~~~~~~~~~~
node_modules/undici/types/connector.d.ts:4:1
4 export = buildConnector
~~~~~~~~~~~~~~~~~~~~~~~
This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
node_modules/undici/types/dispatcher.d.ts:6:13 - error TS1259: Module '"/undiciBug/node_modules/undici/types/readable"' can only be default-imported using the 'esModuleInterop' flag
6 import type BodyReadable from './readable'
~~~~~~~~~~~~
node_modules/undici/types/readable.d.ts:4:1
4 export = BodyReadable
~~~~~~~~~~~~~~~~~~~~~
This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
node_modules/undici/types/handlers.d.ts:1:8 - error TS1259: Module '"/undiciBug/node_modules/undici/types/dispatcher"' can only be default-imported using the 'esModuleInterop' flag
1 import Dispatcher from "./dispatcher";
~~~~~~~~~~
node_modules/undici/types/dispatcher.d.ts:12:1
12 export = Dispatcher;
~~~~~~~~~~~~~~~~~~~~
This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
Environment
Mac
Node 18
Additional context
I can work around the bug by setting esModuleInterop to true in the sample app linked above, but unfortunately that flag causes other problems in my "real" app 😮💨
The text was updated successfully, but these errors were encountered:
Bug Description
Starting in v5.11.0, it seems like the "esModuleInterop" flag is required to get a TypeScript build passing for a project referencing undici. It worked just fine in 5.10.0, and I believe the change to the types files occurred in the following PR by @arontsang, but I'm not sure if it was intentional: #1338
Reproducible By
npm install
npm build
Expected Behavior
The build passes
Actual Behavior
The build fails with these errors:
Environment
Mac
Node 18
Additional context
I can work around the bug by setting
esModuleInterop
totrue
in the sample app linked above, but unfortunately that flag causes other problems in my "real" app 😮💨The text was updated successfully, but these errors were encountered: