-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Uncaught reflect-metadata shim is required when using class decorators #353
Comments
You can workaround this for the time being by adding the following to the top of your polyfills.ts
|
It ended up working when i used it in main.ts and not polyfills. |
I've tried this fix and now I am getting
Any ideas? |
Did you find any solution? |
@skrywus can I see your repo |
can you pull latest and open another issue if you still have a problem thanks |
With What can I do? Currently working around it with |
see polyfills |
Still, its not working for me. I used Any updates on this issue ? |
are you using npm version 3.x.x? |
3.10.5 it is. |
@umasgn add this on top of your entry file:
For some reason webpack needs this. Not sure if it will fix your issue in particular tho. My entry file looks like this:
Also, I'm not using
|
Thank you very much for your reply. I modified file as you mentioned, this time getting different errors 'duplicate identifier .....'. Downgrade reflect-metadata to "reflect-metadata": "^0.1.3" solved the problem. |
Not sure if we had the same issue but I was getting this exception even though the shim was being packaged and loaded before the vendor bundle. This worked for me: new webpack.ProvidePlugin({
Reflect: 'core-js/es7/reflect'
}) |
I'm having this issue when I try to use decorators in my e2e tests. Should it still be enough to import zone.js and reflect-metadata in the polyfills-file when running tests? I literally tried everything, and I am feeling that I am shooting in the dark here. Whatever I do I get the same error
|
Thanks @radusuciu , thats fix the problem for me |
Dear all i am getting the same error every thing was working fine and then the error started. Is there any quick fix for it. I am new in this and its getting very hard to fix it. Thanks keywords if/then/else require v5 option Error: Cannot find module 'reflect-metadata' |
For me it seems like the main.js is loaded before the polyfills.js.
when I turn it around to this:
it works correctly. So now I changed the chunksSortMode in HtmlWebpackPlugin like that:
|
@Phmager I can't thank you enough! I spend working days solving this issue and was about to give up. I do not understand why this nasty bug (race condition style) doesn't generate more noise/attention. If you were not already in Munich, I would send you a beer over as reward for solving the issue 😉 |
Running into the same issue on TOH Part 6 sample and following the steps at https://angular.io/guide/aot-compiler @Phmager : Where are the aot index.html and HtmlWebpackPlugin? I can't find them. This is so frustrating that a standard example and guidelines on angular.io aren't working right off the bat. |
Thanks very much @Phmager . I work fine. Good job |
@when i use in
when i use in
I thought this error maybe becauseof browser and order.
|
Same issue when i run a npm build with the production flag: |
@Phmager Thank you for a solution. Resolved issue. |
Thanks brunolm - Had this problem that solved the problem |
getting this error on master branch.
using npm start
The text was updated successfully, but these errors were encountered: