Skip to content

@swc/[email protected] does not return sourcemap for type-only files, causes error in updateSourceMap #1996

@erikthiem-immuta

Description

@erikthiem-immuta

Search Terms

SWC

Expected Behavior

I am using ts-node with the --swc flag. I expect it to work. It works fine for me on SWC < 1.3.50

Actual Behavior

I tried upgrading to SWC >= 1.3.50 today and it caused ts-node to not work. I unfortunately did not see much useful output. If there is a way to get more useful output to fix this, I am happy to try it.

Steps to reproduce the problem

Upgrade to SWC >= 1.3.50

Minimal reproduction

Be on ts-node version 10.9.1 and SWC version 1.3.50 and try to use ts-node with the --swc flag.

Specifications

  • ts-node version: 10.9.1
  • node version: 18.x
  • TypeScript version: 4.8.4
  • tsconfig.json, if you're using one:
"ts-node": {
    "swc": true
}
  • package.json:
    The relevant part would be:
`... node_modules/ts-node/dist/bin.js --swc --transpile-only index.ts`
  • Operating system and version: Mac
  • If Windows, are you using WSL or WSL2?:

Metadata

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