Ошибка при компиляции TypeScript с помощью systemjs-builder Необработанное отклонение Ошибка при выборке для TypeError: невозможно прочитать свойство

Не уверен, почему я получаю это. Я пытаюсь скомпилировать свой TS с помощью systemjs-builder и получаю эту ошибку.

Необработанное отклонение Ошибка при выборке для приложения/main.js в файле: //... Ошибка типа: невозможно прочитать свойство «файл: ///..../src/app/main.js» неопределенного

Мой файл main.js

/// <reference path="../typings.d.ts" />

import { bootstrap } from '@angular/platform-browser-dynamic';
import { Location, LocationStrategy, HashLocationStrategy} from "@angular/common";
import { enableProdMode } from '@angular/core';

import { ToastsManager } from 'ng2-toastr/ng2-toastr';
import {ToastOptions} from "ng2-toastr/ng2-toastr";

import { AppComponent } from './app.component';
import { APP_ROUTER_PROVIDERS } from './app.routes';

//enableProdMode(); //Uncomment for production

let options = {
    autoDismiss: true,
    positionClass: "toast-top-right"
};

bootstrap(AppComponent, [
        APP_ROUTER_PROVIDERS,
        {
            provide: LocationStrategy, useClass: HashLocationStrategy
        },
        {
            provide: ToastOptions, useValue: new ToastOptions(options)
        },
        ToastsManager
    ])
    .catch(error => console.error(error));  

моя задача gulp compile-ts.js

module.exports = function (gulp, plugins) {
return function () {
    console.log("");
    console.log("TS: Compiling TypeScript into Javascript into Dist folder...");

    var SystemBuilder = require('systemjs-builder');
    var argv = require('yargs').argv;

    var sourceDirName = 'src';
    var sourcePath = './' + sourceDirName;
    var builder = new SystemBuilder(sourcePath, sourcePath +  "/systemjs.config.js")
    var outputFile = argv.prod ? './dist/bundle.min.js' : './dist/bundle.js';

    // The systemJS config is in `./src` and uses `node_modules` as if it's relative to it
    //      which works in lite-server because it shows `./` and `./src` as the same folder
    //      (see bs-config.json)
    //
    // In bundle though, the builder thinks that `node_modules` is relative to `./src`,
    //      not to `./`, which we need to correct by removing `src/` from path.
    builder.bundle('node_modules/*', {
        fetch: function (load, fetch) {
            load.address =
                load.address.replace(sourceDirName + "/node_modules", "node_modules");

            return fetch(load);
        }
    });

    builder.buildStatic('app', outputFile, {
        minify: argv.prod,
        mangle: argv.prod,
        rollup: argv.prod,
        // Keeps URLs in components' `templateUrl` relative to component path
        // See more at http://stackoverflow.com/a/37537725/146656
        encodeNames: false
    });

    console.log("TS: Finished");

};

};


person Mastro    schedule 03.08.2016    source источник