Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript not generated from Typescript

I am creating an Aurelia application using Visual Studio 2015 and Typescript. I am using ASP.Net Core 1.0 R2.

Before yesterday when I compiled my application the .js files were generated and showed up just after the .ts files (see image).

enter image description here

I did something yesterday where they stopped being generated and I have no idea what I did. I am learning Typescript so not familiar enough with this to begin to know where to look. The only results I got searching the internet told me that the .js files were created in an appBundle.js file but I think this is old information because that was not the behavior I was seeing before yesterday, and my Aurelia app is not running because it says it cannot find the .js files.

Can anyone shed some light on what I need to do to get the .js files to be generated again?

UPDATE:

I deleted the app.html and app.ts files and recreated them and then rebuilt the project and suddenly the .js files are showing up and my app runs fine now.

enter image description here

Not sure why this fixed the problem, might be bug.

Anybody have any insight?

like image 360
Gene S Avatar asked May 24 '16 14:05

Gene S


People also ask

Does TypeScript generate JavaScript?

Compiling TypeScript. TypeScript is a typed superset of JavaScript that transpiles to plain JavaScript. It offers classes, modules, and interfaces to help you build robust components.

How do I enable JavaScript in TypeScript?

Simply set allowJs to true in your tsconfig. json compilerOptions and then make sure the . js file is included using files / include / exclude etc.

Which command is used to generate a JavaScript file from a TypeScript file?

When we execute tsc filename. ts , TypeScript will generate a js file with the same name at runtime. To execute the generated js file, run node filename. js .

Which is the process of converting the TypeScript into JavaScript?

So if the code was written in TypeScript, it gets compiled and converted into JavaScript. This process is known as Trans-piled.


1 Answers

I guess the typescript controller is not compiling your .ts files anymore because you have an error in your app.ts file.

This behaviour depends on your settings to the typescript compiler (tsconfig file)

like image 117
kabaehr Avatar answered Oct 06 '22 05:10

kabaehr