Skip to content

Uncaught reflect-metadata shim is required when using class decorators #2008

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

Closed
Chabane opened this issue Sep 7, 2016 · 8 comments
Closed

Comments

@Chabane
Copy link

Chabane commented Sep 7, 2016

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

@kkuriata
Copy link

kkuriata commented Sep 7, 2016

Getting exactly the same error.

@deebloo
Copy link
Contributor

deebloo commented Sep 7, 2016

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

@Chabane Chabane closed this as completed Sep 15, 2016
@spongessuck
Copy link

spongessuck commented Sep 15, 2016

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.

@tonymedrano
Copy link

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.

@sergio8016
Copy link

sergio8016 commented Oct 24, 2017

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

@gajerajatin31
Copy link

Thanks @tonymedrano it's work....

@Dipesh-Jayswal
Copy link

Dipesh-Jayswal commented Dec 8, 2017

Thank @tonymedrano

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants