-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
About debug NestJS in Nx using WebStorm #2701
Comments
I finally solve this problem by adding To be precise, this is issue about
Hope this helps those who are struggling with debug Nx project using ts-node. |
BTW, just for sharing, the
Hope this helps too :D
const JavaScriptObfuscator = require('webpack-obfuscator');
module.exports = (config, context) ={
config.plugins.push(new JavaScriptObfuscator({rotateUnicodeArray: true}));
return config;
};
{
"projects": {"api": {"architect": {"build": {
"configurations": {
"production": {
"sourceMap": false,
"webpackConfig": "apps/api/webpack.prod.config.js"
}}}}}}
}
|
I had similar problem but under VSCode problem was with working directory when I set properly working directory in VSCode using: |
Hi @Areen3, thank you for sharing solutions with others Thank you 😄 |
Hi thisl repo works super with VScode but not working under WebStorm please download repo , this contain one simple project and one library working with node problem is that, these links with error are not cilckable under WS but on this same project in VScod are clickable in mode run or debug and not workint |
I think that, that problem shoud be solved, |
@LouisSung Thanks for sharing your problem description and your solution. This helped me to setup webstorm to debug nest-js application. Earlier, I was not able to debug with webstorm , each time I entered However, I have question on the
Both 1 and 2 worked. |
HI, I'm glad to hear that it helps~ I haven't met a situation that requires that devDependency; therefore, what I can say is that the |
The tsconfig.json
code
|
For anyone else wanting to know how to debug NestJs with WebStorm, here are a few tips: When you run Next, create a run configuration in WS and select Attach to Nodejs/Chrome and create a new configuration by adding the port number. Now add your breakpoints and click on one of the debuggin links above which will open the debugger window in WS. Now use a rest client to send a request to trigger a breakpoint and it should work as expected. You can also edit your serve configuration in your angular.json file (it maybe called something else if you aren't using angular) by adding `port: "port number goes here - 9229 is standard though". Then change your WS run configuration to use this port and now anytime you serve the application, all you need to do is click on the debugger link to launch the debugger and it should work without needing to change the port number in your run configurations (Nx automatically assigns a random open port each time the app is initially launched). |
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. |
Updated
This issue (for WebStorm) has been solved and explained below, and @Areen3 also gives a comment for VSCode
Prerequisites
Expected Behavior
Sorry for not asking question on Stack Overflow because I think it might be a common issue and GitHub is a better place to share these information.
*.controller.ts
file as expected.Current Behavior
dist/api/main.js
, or I can do it in the original*.controller.ts
file?*.controller.ts
that failed due to import issuedist/api/main.js
that works but quite trickyThanks for your help :)
The text was updated successfully, but these errors were encountered: