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

node - esbuild bundler are not attaching debugger - sourcemap not generated #14556

Closed
gaurang171 opened this issue Jan 23, 2023 · 4 comments · Fixed by #14725
Closed

node - esbuild bundler are not attaching debugger - sourcemap not generated #14556

gaurang171 opened this issue Jan 23, 2023 · 4 comments · Fixed by #14725
Labels
outdated scope: node Issues related to Node, Express, NestJS support for Nx type: bug

Comments

@gaurang171
Copy link

Current Behavior

When I build the node application with esbuild, break pints on typescripts are not working but instead in need to go to main.cjs under dist to break.

I created a the workspace with express preset. webpack builds are attaching break points correctly but that doesn't allow me to import esmodules so I tried esbuiids with node application. es modules works but now can not attach break points on TS file.

Expected Behavior

For ES Builds TS break points should work.

Github Repo

No response

Steps to Reproduce

  1. npx nx create-nx-workspace --preset=express
  2. npx nx generate @nrwl/node:application myAppES --no-interactive (builds esbuild optionaly can use --bundler=esbuild)
  3. npx nx generate @nrwl/node:application myAppWP --bundler=webpack --no-interactive

now
npx nx serve myAppES add break points on typescript file. it won't work

same works for myAppWP

Nx Report

Report complete - copy this into the issue template

   Node : 18.13.0
   OS   : win32 x64
   npm  : 8.19.3

   nx : 15.5.3
   @nrwl/angular : Not Found
   @nrwl/cypress : Not Found
   @nrwl/detox : Not Found
   @nrwl/devkit : 15.5.3
   @nrwl/esbuild : 15.5.3
   @nrwl/eslint-plugin-nx : 15.5.3
   @nrwl/expo : Not Found
   @nrwl/express : 15.5.3
   @nrwl/jest : 15.5.3
   @nrwl/js : 15.5.3
   @nrwl/linter : 15.5.3
   @nrwl/nest : Not Found
   @nrwl/next : Not Found
   @nrwl/node : 15.5.3
   @nrwl/nx-cloud : 15.0.2
   @nrwl/nx-plugin : Not Found
   @nrwl/react : Not Found
   @nrwl/react-native : Not Found
   @nrwl/rollup : Not Found
   @nrwl/schematics : Not Found
   @nrwl/storybook : Not Found
   @nrwl/web : Not Found
   @nrwl/webpack : 15.5.3
   @nrwl/workspace : 15.5.3
   @nrwl/vite : Not Found
   typescript : 4.8.4
   ---------------------------------------
   Local workspace plugins:
   ---------------------------------------
   Community plugins:

Failure Logs

No response

Additional Information

No response

@gaurang171
Copy link
Author

It appears esbuilds are missign sourcemap even is the flag is set to true. in main.cjs I am not seeing any references to soucemap.

@AgentEnder AgentEnder added the scope: node Issues related to Node, Express, NestJS support for Nx label Jan 24, 2023
@gaurang171 gaurang171 changed the title node - esbuild bundler are not attaching debugger node - esbuild bundler are not attaching debugger - sourcemap not generated Jan 29, 2023
@gaurang171
Copy link
Author

gaurang171 commented Jan 31, 2023

adding sourcemap: "both" to esbuildOptions under options in project.json file creates the sourcemap and now able to use breakpoints in Ts file.
still assets are not copied to the dist folder when in the watch mode similar to #12901

"options": {
        "esbuildOptions": { "sourcemap":"both" },
........
.........
}

@DibyodyutiMondal
Copy link

DibyodyutiMondal commented Feb 1, 2023

@jaysoo given the changes in the PR that closed this, I assume that the "sourcemap" option for the executor is going to become deprecated and that we're to migrate to "esbuildOptions" for it?

(So that I can go ahead and safely delete the "sourcemap" setting from the target in my project.json)

@github-actions
Copy link

github-actions bot commented Mar 3, 2023

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: node Issues related to Node, Express, NestJS support for Nx type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants