Nicholas-Westby / angular-2-lab

Some tests related to Angular 2.
0 stars 0 forks source link

Reflect-metadata shim is required when using class decorators #1

Open Nicholas-Westby opened 7 years ago

Nicholas-Westby commented 7 years ago

As of this commit (currently the latest): https://github.com/Nicholas-Westby/angular-2-lab/tree/556431694a78106d350112d1421f0ae760d03e6e

I run npm i and npm run webpack and grunt prd, then run the homepage from Visual Studio and I get this error:

reflect-metadata

That says "reflect-metadata shim is required when using class decorators". Perhaps I need to include some extra JavaScript/TypeScript file at the top of my main file.

Nicholas-Westby commented 7 years ago

This newer commit is better to reproduce the issue (has Grunt packages installed): https://github.com/Nicholas-Westby/angular-2-lab/tree/d063744ee1d216659b17e6833065363c169fba4f

Also, NPM install doesn't seem to work right away, so to get started it's more like running npm i, npm update, npm i, npm update, npm i, npm run webpack, grunt prd.

Nicholas-Westby commented 7 years ago

Seems like I may have fixed that error, but I have a new error:

TypeError: angular2_universal_1.platformNodeDynamic is not a function
    at Object.5../app.module (eval at compileFunc (C:\r\AngularLab\AngularLab\bin\edge\double_edge.js:34:28), <anonymous>:1162:37)
    at s (eval at compileFunc (C:\r\AngularLab\AngularLab\bin\edge\double_edge.js:34:28), <anonymous>:950:254)
    at e (eval at compileFunc (C:\r\AngularLab\AngularLab\bin\edge\double_edge.js:34:28), <anonymous>:950:425)
    at eval (eval at compileFunc (C:\r\AngularLab\AngularLab\bin\edge\double_edge.js:34:28), <anonymous>:950:443)
    at compileFunc (C:\r\AngularLab\AngularLab\bin\edge\double_edge.js:35:16)
MarkPieszak commented 7 years ago

Upgrade to the latest Node, typically the reflect-metadata stems from something in Core (I believe) and that you have npm < 3. Just download 7.1 and you'll be all set there.

MarkPieszak commented 7 years ago

Also, it's platformUniversalDynamic(). Don't use the playgrounds from Universal as an example they are very old (we need to just delete them at this point) :( Sorry about that!