Giter Site home page Giter Site logo

Comments (5)

alan-agius4 avatar alan-agius4 commented on September 8, 2024

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.

Talb2005 avatar Talb2005 commented on September 8, 2024

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.

zygarios avatar zygarios commented on September 8, 2024

It's similar to #26323

from angular-cli.

alan-agius4 avatar alan-agius4 commented on September 8, 2024

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.

angular-automatic-lock-bot avatar angular-automatic-lock-bot commented on September 8, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.