Closed josh-sachs closed 7 years ago
If you are using systemjs 0.19 then I think you need to stick with plugin-typescript 5.x.x
I tried with 6.0.4 and 5.3.3 - I think I had this working at one point. I'm trying to understand where that reference to typescript_1["default"] is set as it must be missing from my configuration some how.
I think this is happening inside the plugin itself and is related to https://github.com/frankwallis/plugin-typescript/issues/185
I have a very similar error:
Uncaught (in promise) Error: Cannot read property 'System' of undefined
in the plugin code:
this._options.module = this.getEnum(this._options.module, typescript_1.ModuleKind, typescript_1.ModuleKind.System);
This error occured after trying to update typescript and typescript-plugin.
Unfortunately I didn't manage to rollback to a working state even after restoring project with git + deleting jspm_packages and node_modules and running the install again. Any help is welcome.
EDIT: ok I solved it by pinning the jspm version: https://github.com/piotrwitek/react-redux-typescript-starter-kit/issues/38
I got this working again, but no idea how. this works with plugin-typescript 5 and 6 against systemjs 19.
Here is my working systemjs.config.js file for posterity.
{
"warnings":true,
"map":{
"@angular":"lib:@angular",
"aot":"aot",
"app":"app",
"rxjs":"lib:rxjs/",
"@ngrx/core":"lib:@ngrx/core/",
"@ngrx/store":"lib:@ngrx/store/",
"reflect-metadata":"lib:reflect-metadata/",
"moment":"lib:moment/",
"underscore":"lib:underscore/",
"underscore.string":"lib:underscore/string",
"sortablejs":"lib:sortablejs/",
"clndr":"lib:clndr/",
"swiper":"lib:swiper/",
"select2":"lib:select2/",
"autosize":"lib:autosize/",
"jquery":"lib:jquery/",
"jquery.mousewheel":"lib:jquery.mousewheel/",
"jquery.mCustomScrollbar":"lib:jquery.mCustomScrollbar/",
"hammerjs":"lib:hammerjs/",
"localforage":"lib:localforage/",
"wnumb":"lib:wnumb/",
"clipboard":"lib:clipboard/",
"materialize-css":"lib:materialize-css/dist/js",
"noUiSlider":"lib:materialize-css",
"plugin-babel":"lib:babel/plugin-babel.js",
"systemjs-babel-build":"lib:babel/systemjs-babel-browser.js",
"plugin-typescript":"lib:typescript",
"typescript":"lib:typescript"
},
"meta":{
},
"paths":{
"lib:":"lib/"
},
"packages":{
"@angular/http":{
"main":"/bundles/http.umd.js",
"defaultExtension":"js"
},
"@angular/core":{
"main":"/bundles/core.umd.js",
"defaultExtension":"js"
},
"@angular/router":{
"main":"/bundles/router.umd.js",
"defaultExtension":"js"
},
"@angular/common":{
"main":"/bundles/common.umd.js",
"defaultExtension":"js"
},
"@angular/compiler":{
"main":"/bundles/compiler.umd.js",
"defaultExtension":"js"
},
"@angular/forms":{
"main":"/bundles/forms.umd.js",
"defaultExtension":"js"
},
"@angular/platform-browser":{
"main":"/bundles/platform-browser.umd.js",
"defaultExtension":"js"
},
"@angular/platform-webworker":{
"main":"/bundles/platform-webworker.umd.js",
"defaultExtension":"js"
},
"@angular/platform-browser-dynamic":{
"main":"/bundles/platform-browser-dynamic.umd.js",
"defaultExtension":"js"
},
"@angular/platform-webworker-dynamic":{
"main":"/bundles/platform-webworker-dynamic.umd.js",
"defaultExtension":"js"
},
"aot":{
"defaultExtension":"ts"
},
"app":{
"defaultExtension":"ts"
},
"rxjs":{
"defaultExtension":"ts"
},
"@ngrx/core":{
"defaultExtension":"js",
"main":"index",
"format":"esm",
"meta":{
"*.js":{
"loader":"plugin-babel"
}
}
},
"@ngrx/store":{
"defaultExtension":"js",
"main":"index",
"format":"esm",
"meta":{
"*.js":{
"loader":"plugin-babel"
}
}
},
"reflect-metadata":{
"defaultExtension":"js",
"main":"reflect",
"format":"global"
},
"moment":{
"defaultExtension":"js",
"main":"moment",
"format":"global"
},
"underscore":{
"defaultExtension":"js",
"main":"underscore",
"format":"global"
},
"underscore.string":{
"defaultExtension":"js",
"main":"underscore.string",
"format":"global"
},
"sortablejs":{
"defaultExtension":"js",
"main":"sortable",
"format":"global"
},
"clndr":{
"defaultExtension":"js",
"main":"clndr",
"format":"global"
},
"swiper":{
"defaultExtension":"js",
"main":"swiper",
"format":"global"
},
"select2":{
"defaultExtension":"js",
"main":"select2.full",
"format":"global"
},
"autosize":{
"defaultExtension":"js",
"main":"autosize",
"format":"global"
},
"jquery":{
"defaultExtension":"js",
"main":"jquery",
"format":"global"
},
"jquery.mousewheel":{
"defaultExtension":"js",
"main":"jquery.mousewheel",
"format":"global"
},
"jquery.mCustomScrollbar":{
"defaultExtension":"js",
"main":"jquery.mCustomScrollbar",
"format":"global"
},
"hammerjs":{
"defaultExtension":"js",
"main":"hammer",
"format":"global"
},
"localforage":{
"defaultExtension":"js",
"main":"localforage"
},
"wnumb":{
"defaultExtension":"js",
"main":"wnumb",
"format":"global"
},
"clipboard":{
"defaultExtension":"js",
"main":"clipboard",
"format":"global"
},
"materialize-css":{
"defaultExtension":"js",
"main":"materialize",
"format":"global"
},
"noUiSlider":{
"defaultExtension":"js",
"main":"noUiSlider",
"format":"global"
},
"plugin-typescript":{
"main":"plugin.js"
},
"typescript":{
"main":"typescript.js",
"meta":{
"typescript.js":{
"exports":"ts"
}
}
}
},
"typescriptOptions":{
"target":"es5",
"module":"es6",
"emitDecoratorMetadata":true,
"experimentalDecorators":true
},
"transpiler":"plugin-typescript"
}
This was a duplicate of https://github.com/frankwallis/plugin-typescript/issues/185 and is resolved in 7.0.0
plugin.js line 93 is throwing this error.
line 93:
result.module = getEnum(result.module, typescript_1["default"].ModuleKind, typescript_1["default"].ModuleKind.System);
trying to understand why
typescript_1["default"]
is undefined.