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

Remove 'source-map-support' package in favor of Nodejs built-in source mapping feature #2629

Closed
1 task done
micalevisk opened this issue Jul 3, 2024 · 1 comment · Fixed by #2630
Closed
1 task done
Labels

Comments

@micalevisk
Copy link
Member

micalevisk commented Jul 3, 2024

Is there an existing issue that is already proposing this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe it

as of now @nestjs/cli injects source-map-support. But as they say in their README:

image

we can use nodejs's --enable-source-maps flag instead since nodejs v12

I don't know why this package was added since v12 is too old, to be honest 🤔

Describe the solution you'd like

update the following lines to replace -r "source-map-support/register" with --enable-source-maps

const sourceMapsRegisterPath = this.getSourceMapSupportPkg();
if (sourceMapsRegisterPath !== undefined) {
processArgs.unshift(`-r "${sourceMapsRegisterPath}"`);
}

I tested this is a simple nestjs app and it seems to be working:

code

image

when sourceMap:true in our tsconfig

image

when sourceMap:false in our tsconfig

image

Teachability, documentation, adoption, migration strategy

No response

What is the motivation / use case for changing the behavior?

  1. source-map-support looks abandoned. Their github repository has many PRs and issues open
  2. it has issues such as Error cause is not logged in dev:watch mode #2533 that @nestjs/cli cannot work around
  3. we would have one less dependency on @nestjs/cli
@kamilmysliwiec
Copy link
Member

Would you like to create a PR for this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants