Skip to content

module.exports = { ... } is disallowed when erasableSyntaxOnly is enabled only by tsgo #1955

@sapphi-red

Description

@sapphi-red

Steps to reproduce

  1. Clone https://github.com/sapphi-red-repros/typescript-go-cjs-named-import-behavior-difference
  2. Run pnpm i
  3. Run pnpm tsc and pnpm tsgo

(same repro with #1954)

Behavior with typescript@5.8

No error

Behavior with tsgo

bar.cjs:1:1 - error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled.

1 module.exports = {
  ~~~~~~~~~~~~~~~~~~
2   a: 1,
  ~~~~~~~
3 }
  ~

Metadata

Metadata

Assignees

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