3

When my Firefox debugger (also Chrome) tries to find the source .ts file i'm getting the following error

Error while fetching an original source: request failed with status 404
Source URL: https://localhost:44308/TypeScript/DateTimeHelper.ts

The related source map points to the correct solution location

{"version":3,"file":"DateTimeHelper.js","sourceRoot":"","sources":["../../TypeScript/DateTimeHelper.ts"],"names":[],"mappings":" ...

The path is correct for the VS solution but not for the web site. This may the issue but I'm not sure how to correct it.

I'm running VS 2017

2 Answers 2

2

The problem is the TypeScript folder is outside the wwwroot folder. The answer was to map it so could be seen under the web site root folder

Debugging TypeScript files outside wwwroot

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

Comments

0

You can't reference a .ts file directly, you need to reference a .js file that VS generated from your .ts file.

If VS isnt generating the .js file, try to use this help https://developercommunity.visualstudio.com/content/problem/18814/typescript-compilationgeneration-not-working.html

2 Comments

I think you misunderstand. The JavaScript is being generated correctly. It is the path back to the TypeScript file for debugging purposes that is causing the issue. I'm sure it relates to the way the JavaScript source mapping file links back to the TypeScript file in an ASP.NET Core environment
Oh, i really misunderstood your question, sorry. Do you have a local certificate? If not, the "https" path must be the problem.

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.