question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Typescript on Asp.net Core

See original GitHub issue

I’m submitting a bug report

  • Library Version: 0.15.0

Please tell us about your environment:

  • Operating System: Windows [8.1]

  • Node Version: 4.4.5

  • NPM Version: 3.10.5

  • Language: TypeScript 1.8.6 & 2

Current behavior: I have tried to set-up Aurelia on latest ASP.NET Core using CLI. I am getting error attached in picture when using au build

image

Expected/desired behavior:

Steps to reproduce:

  1. Create Asp.net Core project in VS2015 Update 3
  2. Change to the xproj directory
  3. Run au new --here with the below options a) Platform -> ASP.NET Core b) Transpiler -> Typescript c) CSS Processor -> None d) Unit tests -> No e) Create this project -> Yes f) Install dependencies -> Yes
  4. Run au build
  • What is the expected behavior?

    Be able to bundle app.

  • What is the motivation / use case for changing the behavior?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
iturner100commented, Jul 15, 2016

The sweet spot for me would be to have VS do the tranpiling so you get any TS errors integrated in to the usual VS error pane. Then use the aurelia-cli for bundling etc… And finally use Kestrel for dev server, with BrowserSync etc…

I’ve not got there yet unfortunately…

Using the Command Task Runner extension (https://visualstudiogallery.msdn.microsoft.com/e6bf6a3d-7411-4494-8a1e-28c1a8c4ce99) to add au build as a post-build task in VS helps to some extent

Or you can call some of the aurelia-cli functionality directly from gulp within VS.

Using aurelia-cli inside VSCode works better, but being able to live just within VS2015 is the goal (for me, at least)…

0reactions
JeroenVinkecommented, Mar 12, 2017

I believe that the we no longer need this message if we merge the PR above:

Info Since Aurelia-CLI should be in charge of building your client side code, make sure before running the new command from Aurelia-CLI you add <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked> to your .xproj file inside the first <PropertyGroup></PropertyGroup> you find to stop Visual Studio from compiling the .ts files in your project. If you build your solution before doing this, Visual Studio will compile your .ts files breaking some of the Aurelia-CLI commands.

I do wonder why we have included that message in the docs though. Simply running the project from VS will transpile the typescript files (and launch IIS), but it does not invoke the CLI at all, so it is not going to regenerate the bundles. On the other hand, running au run --watch runs the project using browsersync, and you’ll not be using ASP.NET Core at all. This bit leaves a lot to the imagination when it comes to running the app. @AshleyGrant when you are looking into this issue, can you also see whether or not i’m missing something or if the docs is really missing this info?

My gut feeling is that we will want ASP.NET Core to serve the files from wwwroot (e.g. by adding app.UseFileServer() to the Configure method in Startup.cs). Then in the background we need to keep the bundles updated, but we don’t need to run browsersync, so au build --watch could be helpful here. au build --watch was proposed in https://github.com/aurelia/cli/issues/265 for exactly this reason

I guess it all depends on whether or not you want ASP.NET core to serve the frontend

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create an ASP.NET Core app with TypeScript - Visual Studio
Tutorial: Create an ASP.NET Core app with TypeScript in Visual Studio · Prerequisites · Create a new ASP.NET Core MVC project · Add...
Read more >
Documentation - ASP.NET Core - TypeScript
Install ASP.NET Core and TypeScript · Create a new project · Add TypeScript · Add TypeScript code · Set up the build ·...
Read more >
Build a CRUD App with ASP.NET Core and TypeScript
Secure Your ASP.NET Core + TypeScript Application · In the top menu, click on Applications · Click on Add Application · Select Web...
Read more >
Add TypeScript to an ASP.NET Core project | by Darren Neimke
In this article, I'll walk through the steps it takes to add TypeScript to an ASP.NET Core project. You can follow along by...
Read more >
How to use TypeScript in an ASP.NET Core application ...
Overview. This article explains about how to use TypeScript instead of JavaScript in an ASP.NET application for manipulating the Syncfusion EJ2 for ASP....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found