Skip to content

5.5.0 regression - Named exports of functions are not emitted for CommonJSΒ #58473

Closed

Description

πŸ”Ž Search Terms

commonjs export

πŸ•— Version & Regression Information

  • This changed between versions 5.4.5 and 5.5.0

⏯ Playground Link

https://www.typescriptlang.org/play/?target=7&module=1&isolatedModules=true&verbatimModuleSyntax=false&ts=5.5.0-beta#code/GYVwdgxgLglg9mABMOcAUBKAXIgbnGAE0QG8AoAXzLIFMAPABzgCcpSzFPlUAaSgbjJA

πŸ’» Code

function foo(): void {
}

export {
    foo,
};

πŸ™ Actual behavior

ts 5.5.0-beta and 5.5.0-dev-20240508 both emit:

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.foo = void 0;
function foo() {
}

note missing last line

πŸ™‚ Expected behavior

ts 5.4.5 emit

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.foo = void 0;
function foo() {
}
exports.foo = foo;

Additional information about the issue

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions