I'm trying to add Typescript to an existing .NET MVC project. I however get weird error-messages when I try to build. The Intellisense works and I can see that the typeings works. I can also see the .js-files being generated on manual save, meaning that the compileOnSave works. It's only when I try to build the whole project the errors show up.
I use the following settings in Visual Studio 2015:
Have installed typescript 2.0.3
Added the following devDependencies in my package.json-file
I had an app that showed the 'cannot find module' message in the editor when viewed in Visual Studio 2015 [TypeScript 2.0.6] - but worked perfectly in VSCode!
I tried all the recommended changes found on StackOverflow and on other sites but none of them worked for me. The change that fixed my problem was to remove the 'outDir' property from the tsconfig file! I know that the code in the original question does not use the outDir property but this answer may help somebody else.
This change was also necessary for VS2017. My suggestion: use VSCode if possible! :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With