Sunday, February 18, 2018

karma-typescript-es6-transform: Fixing preset problem after upgrading

Recently, I upgraded the devDependencies in one of my projects to the current versions. This included an update of karma-typescript-es6-transformfrom version 1.0.2 to 1.0.3. Didn't sound dangorous. But afterwards my tests didn't run by karma any more. I just got:

18 02 2018 11:20:49.774:ERROR [karma]: Error: /Users/markus/Development/Ritzlgrmft/ionic-logging-service/node_modules/ionic-configuration-service/dist/index.js: Couldn't find preset "es2015" relative to directory "/Users/markus/Development/Ritzlgrmft/ionic-logging-service/node_modules/ionic-configuration-service/dist"
Transform function:

function (context, callback) {
        if (!context.js) {
            return callback(undefined, false);
        }
        if (isEs6(context.js.ast)) {
            options.filename = context.filename;
            log.debug("Transforming %s", options.filename);
            try {
                context.source = babel.transform(context.source, options).code;
                context.js.ast = acorn.parse(context.source, { sourceType: "module" });
                return callback(undefined, true);
            }
            catch (error) {
                return callback(error, false);
            }
        }
        else {
            return callback(undefined, false);
        }
    }

    at Transformer.handleError (/Users/markus/Development/Ritzlgrmft/ionic-logging-service/node_modules/karma-typescript/dist/bundler/transformer.js:108:19)
    at /Users/markus/Development/Ritzlgrmft/ionic-logging-service/node_modules/karma-typescript/dist/bundler/transformer.js:89:27
    at transform (/Users/markus/Development/Ritzlgrmft/ionic-logging-service/node_modules/karma-typescript-es6-transform/dist/transform.js:57:24)
    at /Users/markus/Development/Ritzlgrmft/ionic-logging-service/node_modules/karma-typescript/dist/bundler/transformer.js:83:17
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
    at process._tickCallback (internal/process/next_tick.js:104:9)

Raed more here: karma-typescript-es6-transform: Fixing preset problem after upgrading.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.