Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3806,10 +3806,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
// it definitely is a module and does not have a synthetic default
return false;
}
// There are _many_ declaration files not written with esmodules in mind that still get compiled into a format with __esModule set
// Meaning there may be no default at runtime - however to be on the permissive side, we allow access to a synthetic default member
// as there is no marker to indicate if the accompanying JS has `__esModule` or not, or is even native esm
return true;
if (!file && getSourceFileOfModule(moduleSymbol)?.fileName.includes("/@types/node/")) {
return true;
}
return hasExportAssignmentSymbol(moduleSymbol);
}
// TypeScript files never have a synthetic default (as they are always emitted with an __esModule marker) _unless_ they contain an export= statement
if (!isSourceFileJS(file)) {
Expand Down
Loading