appharbor and Typescript – 404 errors

In part 1 of setting up and creating the MotorDB application, Typescript was used.

To help demonstrate the application, it is hosted at appharbor However after appharbor pulled down the latest code from GitHub, the sample data was not being displayed.

Looking at the console, several errors are being displayed

motordb_error1

What is important is the two 404 errors, The page cannot find the javascript files that are generated from Typescript. It appears that right now, appharbor is not compiling the typescript files.

To get the javascript files, needed to do the following steps.

  • Within the solution folder, create a Tools\Typescript file.
  • Copy all the typescript files from C:\Program Files (x86)\Microsoft SDKs\TypeScript and C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\TypeScript to the Tools\Javascript folder. Remember if running on 32bit system, remember that there is no “Program Files (x86)” folder
  • Open the ui .csproj file and modify the BeforeBuild target to include the following:
  • <Exec Command=”&quot;$(SolutionDir)Tools\TypeScript\tsc&quot; @(TypeScriptCompile ->’&quot;%(fullpath)&quot;’, ‘ ‘)” />
  • Make sure you have saved the typescript files so that Web Essentials will create the javascript files.
  • In solution  Explorer, click on “Show All Files” button
  • For each generated javascript file, from the context menu, select “Include in Project” You can include both the regular and the minified file, or whatever one your code is linked to,
  • For each file, select the properties can change the property “Copy to Output Directory” to “Copy Always”

Now when appharbor compiles your solution, the created javascript files will be copied, and you will no longer get the 404 errors

Advertisements

My musing about anything and everything

Tagged with: , ,
Posted in appharbor, MotorDB, Typescript

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 9 other followers

%d bloggers like this: