question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uncaught reflect-metadata shim is required when using class decorators

See original GitHub issue

OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?) El Capitan

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.2 node: 4.4.2 os: darwin x64

Repro steps. Was this an app that wasn’t created using the CLI? What change did you do on your code? etc.

  1. Start a project with Angular CLI (Webpack)

  2. Create a standalone class (e.g. a model) with an EventEmitter property.

  3. When new EventEmitter<...>() is called in that class, this error shows on the browser console.

    Uncaught reflect-metadata shim is required when using class decorators

The log given by the failure. Normally this include a stack trace and some more information.

All I see is:

Uncaught reflect-metadata shim is required when using class decorators / output_ast.js:334

Mention any other details that might be useful.

This works fine in a non-webpack setting, like here:

http://plnkr.co/edit/255WLWdkSnZdMfNvCk3I?p=preview

That Plunkr works and shows what I am trying to do. The problem is when I do this exact same thing when using Webpack.

Also, EventEmitter works just fine if used in a component.

I am not sure whether this is a bug or user error. Please apologize me if it’s the latter.

Thanks in advance!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
grigacommented, Aug 21, 2016

I had the same issue when i’ve migrated to angular-cli’s github master branch from npm version

while doing ng init to update angular-cli generated files, i’ve missed import "./polyfills.ts"; on top of main.ts file

adding this line fixed my problem

2reactions
cmermingascommented, Aug 23, 2016

Absolutely. I’ll put something together and upload the repo here this week.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular4 core.es5.js Uncaught reflect-metadata shim is ...
core.es5.js:354 Uncaught reflect-metadata shim is required when using class decorators. I've compared my project to a fresh ng new and they ...
Read more >
Uncaught reflect-metadata shim is required when ... - GitHub
Hi,. I have this error after migrating to webpack.8 : Uncaught reflect-metadata shim is required when using class decoratorscheckReflect.
Read more >
reflect-metadata shim is required when using class decorators
无论换哪个版本的angular,就一直报这个错,polyfills.ts明明Import了reflect-metadata还是报这个错. package.json:.
Read more >
reflect-metadata shim is required when using class decorators
This error was calling out... C:\Users\tom.jaeschke\Documents\whatever\client\node_ modules\@angular\core\bundles\core.umd.js:384.
Read more >
Angular4 core.es5.js Uncaught reflect-metadata shim is ...
Coding example for the question Angular4 core.es5.js Uncaught reflect-metadata shim is required when using class decorators-angular.js.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found