Skip to content

SWC breaks on Windows under special conditions #10458

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
thetutlage opened this issue May 13, 2025 · 0 comments
Open

SWC breaks on Windows under special conditions #10458

thetutlage opened this issue May 13, 2025 · 0 comments
Assignees
Labels
Milestone

Comments

@thetutlage
Copy link

Describe the bug

I am using SWC to create a TypeScript loader for Node.js ESM imports. I have narrowed down the problem to bare-minimum in this repo. https://github.com/thetutlage/windows-nodejs-tests

When I run the code in CI (on Windows) and that code includes a class with 4 or more methods, then the process exits with status code 1.

However, the same CI shows code running fine on Linux. Also, if I reduce the number of methods inside src/user.ts file to 3 (instead of 4), then the CI check passes on Windows too.

To be honest, I have no idea why this is happening and downgrading to 1.10.7 works fine in all the cases.

Input code

## Loader code


  const { code, map } = transformSync(source.toString(), {
    sourceMaps: true,
    module: {
      type: 'es6',
    },
    jsc: {
      target: 'esnext',
      parser: {
        syntax: 'typescript',
      },
    },
  })


## Code that breaks


export class User {
  async getId(_: any) {}

  async getName(_: any) {}

  async getEmail(_: any) {}

  async getAllInfo(_: any) {}
}

Config

{
    sourceMaps: true,
    module: {
      type: 'es6',
    },
    jsc: {
      target: 'esnext',
      parser: {
        syntax: 'typescript',
      },
    },
  }

Link to the code that reproduces this issue

https://github.com/thetutlage/windows-nodejs-tests

SWC Info output

No response

Expected behavior

Everything should work fine regardless of the platform

Actual behavior

Breaks on Windows

Version

1.11.24

Additional context

Here is the CI run for Windows. https://github.com/thetutlage/windows-nodejs-tests/actions/runs/14993280948/job/42121468875

@kdy1 kdy1 self-assigned this May 13, 2025
@kdy1 kdy1 added this to the Planned milestone May 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants