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
{{ message }}
Repository navigation
5.5.0 regression - Named exports of functions are not emitted for CommonJS #58473
changed the title [-]Named exports of functions are not emitted for CommonJS[/-][+]5.5.0 regression - Named exports of functions are not emitted for CommonJS[/+]on May 8, 2024
881f449a8a10839db5d535c3a407621d53c78666 is the first bad commit
commit 881f449a8a10839db5d535c3a407621d53c78666
Author: Ron Buckton
Date: Wed Mar 6 18:43:59 2024 -0500
Hoist function exports to top of module body in CJS/AMD/UMD (#57669)
Yeah, the issue appears to be that collectExternalModuleInfo doesn't do the same thing it does for function declarations when processing export declarations.
What version of TS is the above output from? Is that expected output? Unexpected output?
That output is assigning mockedClassComponent to the exports, not omitting it entirely, so I don't think what you've described is the same thing (and shows that the current state is working).
Activity
[-]Named exports of functions are not emitted for CommonJS[/-][+]5.5.0 regression - Named exports of functions are not emitted for CommonJS[/+]Knagis commentedon May 8, 2024
the problem shows up only with functions. exporting classes or variables via
export { foo }work fine. alsoexport function foo() {}works fine.jakebailey commentedon May 9, 2024
Most likely this was #57669 (you could try using https://www.npmjs.com/package/every-ts to bisect and verify).
Knagis commentedon May 9, 2024
Bisect confirms that it is the cause
jakebailey commentedon May 9, 2024
Yeah, the issue appears to be that
collectExternalModuleInfodoesn't do the same thing it does for function declarations when processing export declarations.Knagis commentedon May 28, 2024
Jake Bailey (@jakebailey) is there a chance the fix for this could be merged before 5.5.1?
jakebailey commentedon Aug 20, 2024
What version of TS is the above output from? Is that expected output? Unexpected output?
That output is assigning
mockedClassComponentto the exports, not omitting it entirely, so I don't think what you've described is the same thing (and shows that the current state is working).meriouma commentedon Aug 20, 2024
Sorry, I think I was tracking the wrong issue.