1

I've created a new template ASP.NET Core site, and I've just stared fiddling around with it. However, I'm finding none of the type script is compiling into javascript. Ever!

I've tried:

  • Clean & rebuild
  • Closing and restarting visual studio
  • Stopping the site in the IIS takbar before restarting
  • Closing the IIS in the taskbar before restarting
  • Switching to IE or Chrome
  • Running VS as admin

I created a completely new project, changed the host port so it was a different URL, before compiling I changed the "Hello world!" and it still displays "Hello world!". It has never even been compiled once with that!

I can put a breakpoint in Startup.cs, but any breakpoints in TypeScript "will not be hit" due to no symbols loaded. __ I found this, and have the same issue here: here. None of the solutions seem to fix the problem.

I've added "watch": true to the tsconfig.json, and it builds fine (and I checked the SDK folders, versions 1.8 and 2.0 - so a late enough version), so typescript has no problem with the setting.

But it's still not compiling, ever!

Edit 2 Found this discussion, which says to add "compileOnSave": true to the tsconfiguration file. Still no result.

I can't believe how difficult it's been to get a template project to compile! It doesn't feel like it's pickup up the config file at all, as I'd had compileOnSave in the CompileOptions when it shouldn't be - yet no errors were reported. I've tried moving it alongside the wwwroot folder.

1 Answer 1

1

At last!

Found the issue. I had updated Node.js with a manual install and directed visual studio to it but I hadn't updated NPM! I'd assumed the latest version of node shipped with the latest version of NPM.

Ran npm install npm@latest -g to update NPM, deleted the node-modules and re downloaded packages.

All works.

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

Comments

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.