Ask Your Question
2

How can one activate source maps for the Angular Universal server?

asked 2023-05-31 18:44:59 +0000

djk gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-05-31 19:12:02 +0000

plato gravatar image

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-05-31 18:44:59 +0000

Seen: 7 times

Last updated: May 31 '23