-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tslib_1.__metadata is not a function #199
Comments
I think the solution to this is probably to use the es module version of tslib: https://github.com/Microsoft/tslib/blob/master/tslib.es6.js
|
@frankwallis, thanks to your help, I came up with the SystemJS configuration as follows, which allows both making TypeScript produce modules in the System.config({
transpiler: 'ts',
typescriptOptions: {
emitDecoratorMetadata: true,
experimentalDecorators: true,
importHelpers: true,
target: 'ES5',
module: 'system'
},
map: {
'@angular': 'node_modules/@angular',
'rxjs' : 'node_modules/rxjs',
'tslib' : 'node_modules/tslib'
},
paths: {
'ts': 'node_modules/plugin-typescript/lib',
'typescript': 'node_modules/typescript'
},
meta: {
'@angular/*': {esModule: true}
},
packages: {
'app' : {main: 'main', defaultExtension: 'ts'},
'rxjs' : {main: 'Rx'},
'@angular/core' : {main: 'bundles/core.umd.min'},
'@angular/common' : {main: 'bundles/common.umd.min'},
'@angular/compiler' : {main: 'bundles/compiler.umd.min'},
'@angular/router' : {main: 'bundles/router.umd.min'},
'@angular/platform-browser' : {main: 'bundles/platform-browser.umd.min'},
'@angular/platform-browser-dynamic': {main: 'bundles/platform-browser-dynamic.umd.min'},
'ts' : {main: 'plugin'},
'typescript' : {main: 'lib/typescript', meta: {'lib/typescript.js': {exports: 'ts'}}},
'tslib' : {main: 'tslib.es6'}
}
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using SystemJS 0.20.9 set to transpile
.ts
files on the fly with TypeScript 2.2.1 withimportHelpers: true
produces the following error in run-time:The SystemJS config is as follows
The
package.json
Setting
module: 'commonjs'
in thetypescriptOptions
object, fixes the issue and does not produce any errors.However, when the
typescriptOptions
object configured withmodule: 'commonjs'
, there are warnings in the console:I believe there should be a solution to both make TypeScript produce modules in the
System.register
format and using the much anticipatedimportHelpers: true
option with the TypeScript compiler.Thank you in advance for any leads and help!
The text was updated successfully, but these errors were encountered: