TypeScript not compiling
See original GitHub issue[Running] ts-node "d:\dropbox\work\dev\yreuq.js\temp-zadfghcabp.typescript"
d:\dropbox\work\dev\yreuq.js\temp-zadfghcabp.typescript:1
(function (exports, require, module, __filename, __dirname) { function isPathEqual(a: number[], b: number[]): boolean {
^
SyntaxError: Unexpected token :
at createScript (vm.js:53:10)
at Object.runInThisContext (vm.js:95:10)
at Module._compile (module.js:543:28)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Function.Module.runMain (module.js:605:10)
at Object.<anonymous> (C:\Users\axefr\AppData\Roaming\npm\node_modules\ts-node\src\_bin.ts:177:12)
at Module._compile (module.js:571:32)
[Done] exited with code=1 in 1.977 seconds
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Visual Studio not compiling TypeScript - Stack Overflow
My solution was to roll back the .ts file until it compiled (i.e. the timestamps of typescript and javascript files were identical) and...
Read more >TypeScript Compiling with Visual Studio Code
To generate source maps for your TypeScript files, compile with the --sourcemap option or set the sourceMap property in the tsconfig. json file...
Read more >TS does not compile .ts files #32326 - microsoft/TypeScript
TS doesn't compile files ... Actual behavior: Nothing happens. .js version is not created. $ npm run tsc > ts2@1.0.0 tsc /Users/ ...
Read more >Compile TypeScript Project - TutorialsTeacher
As you know, TypeScript files can be compiled using the tsc <file name>.ts command. It will be tedious to compile multiple .ts files...
Read more >Compiling TypeScript into JavaScript - JetBrains Rider
By default, the built-in compiler does not create source maps that will let you step through your TypeScript code during a debugging session ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@axefrog: The reason is that the automatically generated temporary file for your unsaved code (
tempCodeRunnerFile.typescript
) doesn’t end with “.ts”, so ts-node seems to interpret it as JavaScript instead of TypeScript. As a workaround, you can save the file with “.ts” ending or add the following to your user settings:@formulahendry: I’ve created a corresponding pull request to apply the correct file ending to the default configuration (#166).
That’s cool. Thanks @philmueller !