-
Notifications
You must be signed in to change notification settings - Fork 185
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
Reflect.getMetadata is not a function #44
Comments
I had a similar problem upgrading to angular2 2.0.1 from 2.0.0-rc5. At the same time I upgraded angular-cli from 1.0.0-beta.11-webpack.2 to 1.0.0-beta.15. when running 'ng init' i was a bit prescriptive in what I allowed angular-cli to update: one of the things it wanted to change was main.ts, adding the line |
I'm also getting this error. On the latest version of Angular and not using angular-cli. I thought polyfills were no longer used? |
Any update on this? I too am having this problem. |
I wanted to use reflect-metadata without Angular just to include it in a project with run-time type introspection of class properties, so I tried a very simple example with tsconfig.json target=ES2017, module=2015 and a simple test.ts: import 'reflect-metadata';
function logType(target : any, key : string) {
var t = Reflect.getMetadata("design:type", target, key);
console.log(`${key} type: ${t.name}`);
}
export class Demo {
@logType
test: Date;
}
console.log(Reflect.getMetadata('design:type', new Demo(), "test")); And it complains: |
I added the reflect-metadata types and that resolved my problem |
I ran into this problem inside a lib. I resolved it by following @bashleigh's example and installing the types,
But also had to add an entry within tsconfig.lib.json: {
"extends": "../../tsconfig.json",
"compilerOptions": {
...
"types": [
"reflect-metadata"
]
}
} |
So i have update to the latest RC7 of angular2 and now im getting this error :
Reflect.getMetadata is not a function
What can I do to fix this issue, I'm using the 0.1.2 version. (Also tried with the latest 0.1.8)
Thanks in advance!
The text was updated successfully, but these errors were encountered: