Uncaught reflect-metadata shim is required when using class decorators
Hi,
I have this error after migrating to webpack.8 : Uncaught reflect-metadata shim is required when using class decoratorscheckReflect
- OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?) Window 7
- Versions. Please run
ng --version. If there's nothing outputted, please run in a Terminal:node --versionand paste the result here: angular-cli: 1.0.0-beta.11-webpack.8 node: 6.3.1 os: win32 x64 - 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.
- 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
Getting exactly the same error.
make sure you import the polyfills.ts file in your main.ts file.

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.
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.
Worked on MAC too. Thank you Tony. But i just installed it on the project directory only.
Thanks @tonymedrano it's work....
Thank @tonymedrano
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.