Skip to content

Conversation

@jakebailey
Copy link
Member

@jakebailey jakebailey commented Feb 14, 2025

Per discussion; this syntax isn't supported by Node.js/Amaro or ts-blank-space, and export= is not actually erasable as its transformed syntax is module.exports=.

This effectively means you can't write any CJS code under erasableSyntaxOnly (without using const foo = require("foo") and module.exports = ... directly, which do not bind in TS). Perhaps we can make const foo = require("...") and module.exports = ... bind like they do in JS for TS files in the future.

Updates #59601
Updates #61011

return MyClassOk;
}());
//// [commonjs.cjs]
"use strict";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh no, this means that CJS isn't even erasable because we assume strict and always insert it

@jakebailey jakebailey merged commit 0f4737e into microsoft:main Feb 14, 2025
32 checks passed
@jakebailey
Copy link
Member Author

@typescript-bot cherry-pick this to release-5.8

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 14, 2025

Starting jobs; this comment will be updated as builds start and complete.

Command Status Results
cherry-pick this to release-5.8 ✅ Started ✅ Results

@typescript-bot
Copy link
Collaborator

Hey, @jakebailey! I've created #61178 for you.

@gkiely
Copy link

gkiely commented Feb 18, 2025

@jakebailey
Copy link
Member Author

No, definitely not. I forgot that default exports and export= are the same node.

@jakebailey
Copy link
Member Author

Fix in #61210.

@jakebailey
Copy link
Member Author

Merged, so should be fixed in the next nightly. I'm glad at least one person is testing them...

jakebailey added a commit that referenced this pull request Feb 20, 2025
…e-5.8 (#61178)

Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
@sandersn sandersn removed this from PR Backlog Apr 22, 2025
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants