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

fix: VS Code breakpoint with tsx and Nodejs 20.12.0 does not work #517

Closed
wants to merge 1 commit into from

Conversation

piquark6046
Copy link

Fix #506

Copy link
Owner

@privatenumber privatenumber left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

Can you pull in #513 for tests?

import type { Transformed } from './utils/transform/apply-transformers.js';

const inlineSourceMapPrefix = '\n//# sourceMappingURL=data:application/json;base64,';
const isPrepareStackTraceExposed = Semver.satisfies(process.versions.node, '>=20.12.0');
Copy link
Owner

Choose a reason for hiding this comment

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

Versioned features live here: https://github.com/privatenumber/tsx/blob/develop/src/utils/node-features.ts

Instead of semver, use the isFeatureSupported function

@@ -18,7 +20,7 @@ export const installSourceMapSupport = () => {
*
* https://github.com/nodejs/node/blob/91193825551f9301b6ab52d96211b38889149892/lib/internal/errors.js#L141
*/
&& typeof Error.prepareStackTrace !== 'function'
&& isPrepareStackTraceExposed ? typeof Error.prepareStackTrace === 'function' : typeof Error.prepareStackTrace !== 'function'
Copy link
Owner

Choose a reason for hiding this comment

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

Confused what's happening here. It's checking if it's a function, and then if it's not a function.

What are we actually trying to check for here? Can you update the comment?

@piquark6046
Copy link
Author

I close my PR and please continue in #518.

@piquark6046 piquark6046 closed this Apr 4, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

VS Code breakpoint with tsx and Nodejs 20.12.0 does not work
2 participants