Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To activate source maps for the Angular Universal server, follow the below steps:

  1. Install the dev dependencies using the npm command:

npm i --save-dev source-map-support

  1. Add the below line of code at the top of the server.ts file:

require('source-map-support').install();

  1. Compile the server.ts file with the --sourceMap flag using the tsc command:

tsc server.ts --sourceMap

  1. Start the server by running the compiled JavaScript file:

node dist/server.js

The source maps should now be active for the Angular Universal server. Any errors or logs will now show the exact location of the source file where the error occurred.