Comments (5)
To debug SSR, you need to use the Node.js inspector. Run the command node --inspect-brk node_modules/.bin/ng serve
. I discussed this with @clydin yesterday, and we decided to add an option in ng serve
to automatically include the inspector.
from angular-cli.
Thanks for your reply @alan-agius4.
I would like to debug server.ts, which is the entry point for my API routes.
Would debugging the ng serve process let me achieve that?
From what I understand, ng serve doesn't use server.ts at all. Correct?
I've just tried node --inspect-brk node_modules/.bin/ng serve
on a new ssr project and all I see is
Debugger listening on ws://127.0.0.1:9229/dc4150f4-c734-437b-8f2a-7f0acec721cc For help, see: https://nodejs.org/en/docs/inspector
But it doesn't serve anything and the debugger isn't stopping on any breakpoints.
from angular-cli.
It's similar to #26323
from angular-cli.
I would like to debug server.ts, which is the entry point for my API routes.
Would debugging the ng serve process let me achieve that?
From what I understand, ng serve doesn't use server.ts at all. Correct?
Correct, in that case you need to use node --inspect-brk dist/<project>/server/server.mjs
But it doesn't serve anything and the debugger isn't stopping on any breakpoints.
Are you attaching to the inspector process from your IDE? There are a large number resources online on how you can debug a Node.js application using various IDEs.
from angular-cli.
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
from angular-cli.
Related Issues (20)
- Decorator metadata missing in production build HOT 5
- tsconfig not found when no project architect `build` is available HOT 3
- Angular's minification breaks class extensions when super() returns objects HOT 5
- Simbols not supported on Dir HOT 2
- BUG: The document object is not available in this context after upgrading to 18.2.0-next.3 HOT 3
- Live reloading not working after changes Angular 17 HOT 1
- `ng build` throws on `import inspector from 'node:inspector';` on gentoo default node.js install HOT 1
- Command `ng build` fails behind corporate proxy HOT 2
- Build watch EPERM operation not permitted, copyfile on second emit HOT 2
- --stats-json to allow giving stats to both server and browser, separately HOT 1
- Update component schematic to 'export default class' by default HOT 1
- Option 'declarationDir' cannot be specified with option 'outFile'. HOT 1
- Schematic input does not validate against the Schema HOT 1
- generate component: Add an option to fine-tune the inclusion of lifecycle hooks HOT 1
- Typescript cannot find module that was defined in "paths" tsconfig.app.json HOT 1
- Angular doesn't properly bundles stylesheets into the library's output HOT 5
- Support Custom Loaders for File Extensions in@angular-devkit/build-angular:browser-esbuild HOT 1
- Followup of #24916 ng serve often caches old component code HOT 4
- Report which route failed during pre-rendering.
- support playwright in ng e2e HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-cli.