angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Uncaught reflect-metadata shim is required when using class decorators

Open Chabane opened this issue 10 years ago • 8 comments

Hi,

I have this error after migrating to webpack.8 : Uncaught reflect-metadata shim is required when using class decoratorscheckReflect

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?) Window 7
  2. Versions. Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here: angular-cli: 1.0.0-beta.11-webpack.8 node: 6.3.1 os: win32 x64
  3. Repro steps. Was this an app that wasn't created using the CLI? What change did you do on your code? etc. It's worked fine with [email protected]. After I upgrated to [email protected]. I got the errors below.
  4. The log given by the failure. Normally this include a stack trace and some more information.

decorators.js:173Uncaught reflect-metadata shim is required when using class decoratorscheckReflect @ decorators.js:173(anonymous function) @ decorators.js:175__webpack_require__ @ bootstrap b71fb3d…:52(anonymous function) @ decorators.js:9__webpack_require__ @ bootstrap b71fb3d…:52(anonymous function) @ opaque_token.js:9__webpack_require__ @ bootstrap b71fb3d…:52(anonymous function) @ di.js:16__webpack_require__ @ bootstrap b71fb3d…:52(anonymous function) @ metadata.js:9__webpack_require__ @ bootstrap b71fb3d…:52(anonymous function) @ index.js:17__webpack_require__ @ bootstrap b71fb3d…:52(anonymous function) @ lexer.js:9__webpack_require__ @ bootstrap b71fb3d…:52(anonymous function) @ i18n_parser.js:21__webpack_require__ @ bootstrap b71fb3d…:52(anonymous function) @ extractor_merger.js:24__webpack_require__ @ bootstrap b71fb3d…:52(anonymous function) @ message_bundle.js:22__webpack_require__ @ bootstrap b71fb3d…:52(anonymous function) @ main.bundle.js:76909__webpack_require__ @ bootstrap b71fb3d…:52(anonymous function) @ index.js:17__webpack_require__ @ bootstrap b71fb3d…:52(anonymous function) @ index.js:21__webpack_require__ @ bootstrap b71fb3d…:52(anonymous function) @ simulation.routing.ts:7__webpack_require__ @ bootstrap b71fb3d…:52(anonymous function) @ main.ts:3(anonymous function) @ webcomponents-lite.min.js:12 client?93b6:71 [WDS] Disconnected!sock.onclose @ client?93b6:71EventTarget.dispatchEvent @ eventtarget.js:51(anonymous function) @ main.js:356

Chabane avatar Sep 07 '16 08:09 Chabane

Getting exactly the same error.

kkuriata avatar Sep 07 '16 12:09 kkuriata

make sure you import the polyfills.ts file in your main.ts file. screen shot 2016-09-07 at 12 11 36 pm

deebloo avatar Sep 07 '16 16:09 deebloo

Shouldn't webpack produce polyfills.bundle.js file based on polyfills.ts that gets injected into the page automatically?

EDIT:

Nevermind, it seems like #1633 changed this.

spongessuck avatar Sep 15 '16 15:09 spongessuck

Hi there, my experimental solution in Windows for now is: -Got to directory: C:\Users"Your User"\AppData\Roaming\npm\node_modules\angular-cli

npm install reflect-metadata
npm install portfinder

It´s working for me and apply for any platform if you can access the final path as above. Hope this help.

tonymedrano avatar Nov 16 '16 11:11 tonymedrano

Worked on MAC too. Thank you Tony. But i just installed it on the project directory only.

sergio8016 avatar Oct 24 '17 01:10 sergio8016

Thanks @tonymedrano it's work....

gajerajatin31 avatar Dec 05 '17 06:12 gajerajatin31

Thank @tonymedrano

Dipesh-Jayswal avatar Dec 08 '17 05:12 Dipesh-Jayswal

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.