I have a peculiar error in which the .js file is generated successfully through the sudo tsc sandbox.ts
(I use a mac running the latest version and use MAMP for localhost). Now for the peculiar part, let’s say in the .ts file I put some comments and afterwards console.log("Hello World")
and then run the command for the .js file. The .js file gets generated with no issues. Afterwards I add the .js file to an html file through the line <script type="text/javascript" src='file.js'></script>
. Now what the browser sees is everything until the console.log line (it’s just not there like it’s not written,not any errors or 404’s). I have tried running a separate new js file and it worked with no issues as well inside of the html page.
Also good to mention in the tsconfig file I have set the target for ES6.