2

We have a problem with at ts files not giving the same js files on all diffent two computers.

Both computers have semi-fresh installs of Win10 and VS2015 Enterprise (installed medio may).

We open the same ts file in Visual Studio and save it WITHOUT making any change to the files, but my output is diffent from my coworkers output.

We have checkhed the procect settings for Typescript and they are the same. What else can give the problem? We are new to typescript and neither google or stackovwerflow have been able to give us the answer this far.

The ts file look like this:

    export class App {
    public router: any;
    configureRouter(config, router) {
        config.title = 'Start';
        config.map([
            { route: 'start/:SBTSystemId', name: 'start', moduleId: './components/Start', title: 'Start', nav: false },
            { route: 'symptom/:SBTSystemId', name: 'symptom', moduleId: './components/symptom', title: 'Symptom', nav: false },
            { route: ['diagnostic/:SBTSystemId/:StepId/:PrevStepId', 'diagnostic/:SBTSystemId/:StepId'], name: 'diagnostic', moduleId: './components/diagnostic', title: 'Diagnostic', nav: false },
            { route: 'conclusion/:SBTSystemId/:ConclusionId/:PrevStepId', name: 'conclusion', moduleId: './components/conclusion', title: 'Conclusion', nav: false }
        ]);

        this.router = router;

    }
}
export function configure(aurelia) {
    aurelia.use
        .standardConfiguration()
        .developmentLogging()
        .globalResources(['assets/custom-elements/TopNavigationCustomElement', 'assets/custom-elements/BottomNavigationCustomElement', 'assets/custom-elements/SbtLinkCustomElement']);
    aurelia.start().then(() => aurelia.setRoot('app'));
}

My output is:

    System.register([], function(exports_1, context_1) {
    "use strict";
    var __moduleName = context_1 && context_1.id;
    var App;
    function configure(aurelia) {
        "use strict";
        aurelia.use
            .standardConfiguration()
            .developmentLogging()
            .globalResources([
            "assets/custom-elements/TopNavigationCustomElement",
            "assets/custom-elements/BottomNavigationCustomElement",
            "assets/custom-elements/SbtLinkCustomElement"]);
        aurelia.start().then(function () { return aurelia.setRoot("app"); });
    }
    exports_1("configure", configure);
    return {
        setters:[],
        execute: function() {
            App = (function () {
                function App() {
                }
                App.prototype.configureRouter = function (config, router) {
                    config.title = "Start";
                    config.map([
                        {
                            route: "start/:SBTSystemId", name: "start",
                            moduleId: "./components/Start", title: "Start", nav: false
                        },
                        {
                            route: "symptom/:SBTSystemId", name: "symptom",
                            moduleId: "./components/symptom", title: "Symptom", nav: false
                        },
                        {
                            route: ["diagnostic/:SBTSystemId/:StepId/:PrevStepId", "diagnostic/:SBTSystemId/:StepId"], name: "diagnostic",
                            moduleId: "./components/diagnostic", title: "Diagnostic", nav: false
                        },
                        {
                            route: "conclusion/:SBTSystemId/:ConclusionId/:PrevStepId", name: "conclusion",
                            moduleId: "./components/conclusion", title: "Conclusion", nav: false
                        }
                    ]);
                    this.router = router;
                };
                return App;
            }());
            exports_1("App", App);
        }
    }
});
//# sourceMappingURL=app.js.map

His output is:

    "use strict";
var App = (function () {
    function App() {
    }
    App.prototype.configureRouter = function (config, router) {
        config.title = 'Start';
        config.map([
            { route: 'start/:SBTSystemId', name: 'start', moduleId: './components/Start', title: 'Start', nav: false },
            { route: 'symptom/:SBTSystemId', name: 'symptom', moduleId: './components/symptom', title: 'Symptom', nav: false },
            { route: ['diagnostic/:SBTSystemId/:StepId/:PrevStepId', 'diagnostic/:SBTSystemId/:StepId'], name: 'diagnostic', moduleId: './components/diagnostic', title: 'Diagnostic', nav: false },
            { route: 'conclusion/:SBTSystemId/:ConclusionId/:PrevStepId', name: 'conclusion', moduleId: './components/conclusion', title: 'Conclusion', nav: false }
        ]);
        this.router = router;
    };
    return App;
}());
exports.App = App;
function configure(aurelia) {
    aurelia.use
        .standardConfiguration()
        .developmentLogging()
        .globalResources(['assets/custom-elements/TopNavigationCustomElement', 'assets/custom-elements/BottomNavigationCustomElement', 'assets/custom-elements/SbtLinkCustomElement']);
    aurelia.start().then(function () { return aurelia.setRoot('app'); });
}
exports.configure = configure;
//# sourceMappingURL=app.js.map

On top of it all my output breaks the application (making the aurelia framework call the configure method twice, but his output works just fine).

Anyone have a clue as to what is going on? The project was created in VS2013 about one month prior to the upgrade to VS2015 if that has any influence.

Out typescript project settings are these: Visual Studio project settings

Tomasz Jakub Rup
  • 10,502
  • 7
  • 48
  • 49
MooreHojer
  • 21
  • 5
  • typescript is a pure mystery, clean your projects before building, always – Ceylan Mumun Kocabaş Jun 08 '16 at 10:06
  • 2
    I'd think you're running different versions of the Typescript compiler. And, indeed, always clean your projects and rebuild, so that you will surely have generated JavaScript to run. – Roy Dictus Jun 08 '16 at 10:51
  • @CeylanMumunKocabaş tried that with no success – MooreHojer Jun 08 '16 at 11:55
  • @RoyDictus how do i check for the version of the compiler (I'm a total noob) – MooreHojer Jun 08 '16 at 11:56
  • @MooreHojer http://stackoverflow.com/questions/23948348/where-can-i-find-the-typescript-version-installed-in-visual-studio – Roy Dictus Jun 08 '16 at 12:43
  • On my machine the TypeScript compilers are all in `C:\Program Files (x86)\Microsoft SDKs\TypeScript` Check to make sure you both have the same version. Also, make sure that you both have the same updates installed in Visual Studio. – Maurice Reeves Jun 08 '16 at 13:42

1 Answers1

0

problem solved. My coworkers VS did not transpile the ts file at all. His output is from commonJS, but after changing to System the js file is no longer transpiled by VS. Deleteing the content of the js files and saving ts file again gave him the same output as me. So it seems like af VS bug

MooreHojer
  • 21
  • 5