Skip to content
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

Debugger will not stop at break points when using swc-jest #656

Open
maxmil opened this issue May 14, 2022 · 1 comment
Open

Debugger will not stop at break points when using swc-jest #656

maxmil opened this issue May 14, 2022 · 1 comment

Comments

@maxmil
Copy link

maxmil commented May 14, 2022

I think that this is because source maps must be generated inline.

A fix for this was proposed in #632, which set's the source map as inline for jest if it is undefined however it is not undefined by default.

I'm configuring jest in package.json using the preset

"jest": {
    "preset": "@swc-node/jest",
    ...
}

A workaround is to set it manually

"jest": {
  "transform": {
    "^.+\\.(t|j)sx?$": [
      "@swc-node/jest",
      {
        "swc": {
          "sourceMaps": "inline"
        }
      }
    ]
  },
  ...
}

I notice that when reading tsconfig it is given a default value. This may be the problem.

export function createSourcemapOption(options: ts.CompilerOptions) {
return options.sourceMap !== false
? options.inlineSourceMap
? 'inline'
: true
: options.inlineSourceMap
? 'inline'
: false
}

@mutoe
Copy link

mutoe commented Oct 25, 2022

Ran into the same issue, thanks for the workaround

@Brooooooklyn Brooooooklyn pinned this issue Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants