Angular2 + Jspm.io: metadata reflector required when using class decorators

I have the following problem with running the following versions of JSPM with Angular2 and SystemJS (Versions: Angular @ 2.0.0-alpha.27 with JSPM @ 0.16.0-beta.2 and SystemJS @ 0.18. 0) What after typescript compilation (no errors ) I get the following error in the browser:

/jspm_packages/npm/angular2@2.0.0-alpha.27/src/util/decorators.js:70 Uncaught reflect-metadata shim is required when using class decorators 

Now, when I manually include the file Reflect.js: \ jspm_packages \ npm \ reflection-metadata@0.1.0 \ Reflect.js, the problem disappears, but the following problem occurs: the list is undefined within another angular file.

See the src bitpack below for configuration files (src code) from both system and typescript / jspm.io

https://bitbucket.org/schippie/angular-2-jspm-hello-world/src/8af83f2066e5e3e9eede7db495545234f3b0c04a

I am wondering if it is currently possible to use jspm together with system.js to restore all angular packages that are necessary for angular to work properly. Seeing that the config for system.js clearly states that angular depends on it:

 "npm:angular2@2.0.0-alpha.27": { "fs": "github:jspm/nodelibs-fs@0.1.2", "path": "github:jspm/nodelibs-path@0.1.0", "process": "github:jspm/nodelibs-process@0.1.1", "reflect-metadata": "npm:reflect-metadata@0.1.0", "rx": "npm:rx@2.5.1", "url": "github:jspm/nodelibs-url@0.1.0", "zone.js": "npm:zone.js@0.5.1" }, 

But they are not retrieved (looking at the network tab)

+52
angular jspm systemjs
Jun 18 '15 at 9:42 on
source share
3 answers

Robwormald wrote a beautifully detailed explanation that covers the problems that people may have at that moment and time trying to get angular alpha 27 to work with jspm and typescript https://gist.github.com/robwormald/429e01c6d802767441ec

+13
Jun 18 '15 at 16:33
source share

Yes, what you are looking for is possible and works great. It seems that you have dependency rights. I think that you are missing only the following, which should be at the beginning of your top level typescript or JavaScript file. In particular, they must be before the first line, which loads Angular.

 import 'zone.js'; import 'reflect-metadata'; 

(Another answer points to a detailed but off-site explanation.)

+64
Sep 29 '15 at 1:49
source share

If this problem occurs in Angular 4.4+, it can help if you restart ng serve .

+3
Oct 21 '17 at 11:35
source share



All Articles