8

I have a project with Typescript and Electon. I want the console errors referenced to Typescript files, instead of javascript minified files. I read it could be done with source maps.

I see some references like this but I have not achieved my goal.

2
  • 1
    What have you tried? Can you give us more context, like the way you compile your TS? Commented May 11, 2016 at 16:29
  • @Abel were you able to fix it? Commented Mar 19, 2021 at 8:19

2 Answers 2

3

I was able to get this working with the npm module 'source-map-support'.

Install it in your project as follows:

npm install --save source-map-support

Then require it into your Electron renderer process at the first line of code as follows:

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

See here for full details: https://www.npmjs.com/package/source-map-support

Sign up to request clarification or add additional context in comments.

Comments

3

I was able to get it to work by enabling both inlineSourceMap and inlineSources in tsconfig.json.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.