# Reflect.metadata is not a function

**URL:** <https://discuss.elastic.co/t/reflect-metadata-is-not-a-function/231856>\
**Category:** APM\
**Created:** [May 9, 2020, 5:42pm UTC](https://discuss.elastic.co/t/reflect-metadata-is-not-a-function/231856 "2020-05-09T17:42:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![VamsiSama](https://avatars.discourse-cdn.com/v4/letter/v/bb73d2/32.png) [@VamsiSama](https://discuss.elastic.co/u/VamsiSama)\
**Post date:** [May 9, 2020, 5:42pm UTC](https://discuss.elastic.co/t/reflect-metadata-is-not-a-function/231856/1 "2020-05-09T17:42:47Z")

</div>

Hi Team,

I am Using angular 9 Version CLI and Angular Version 9 and when i try to implement the syntax as per your guideliness in the website,

When i try to import APMService in the Providers i face the issue as show in the image .

import { ApmService } from "@elastic/apm-rum-angular";

Code tried in 2 formats:

Format 1:

providers: [{  
provide: ApmService,  
useClass: ApmService,  
deps: [Router]  
}],

Format 2 : providers:[ApmService]

Error :

apm-service.js:8 Uncaught TypeError: Reflect.metadata is not a function  
at Module../node\_modules/@elastic/apm-rum-angular/dist/es2015/apm-service.js (apm-service.js:8)  
at **webpack\_require** (bootstrap:79)  
at Module../node\_modules/@elastic/apm-rum-angular/dist/es2015/index.js (index.js:1)  
at **webpack\_require** (bootstrap:79)  
at Module../src/app/app.module.ts (app.module.ts:1)  
at **webpack\_require** (bootstrap:79)  
at Module../src/main.ts (main.ts:1)  
at **webpack\_require** (bootstrap:79)  
at Object.0 (main.ts:12)  
at **webpack\_require** (bootstrap:79)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/8/3/83ba8b11a32b6470b032fbe91547759e1c837d8e.png)

---

<div class="post-metadata">

**Author:** ![vigneshshanmugam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vigneshshanmugam/32/40324_2.png) [@vigneshshanmugam](https://discuss.elastic.co/u/vigneshshanmugam)\
**Post date:** [May 12, 2020, 2:51pm UTC](https://discuss.elastic.co/t/reflect-metadata-is-not-a-function/231856/2 "2020-05-12T14:51:39Z")

</div>

Hi @VamsiSama,

It seems like an already reported problem, Please find the solution here [Has anyone been able to use @elastic/apm-rum-angular with aot?](https://discuss.elastic.co/t/has-anyone-been-able-to-use-elastic-apm-rum-angular-with-aot/198456/2)

Let us know if you need any other help.

Thanks,  
Vignesh

---

<div class="post-metadata">

**Author:** ![VamsiSama](https://avatars.discourse-cdn.com/v4/letter/v/bb73d2/32.png) [@VamsiSama](https://discuss.elastic.co/u/VamsiSama)\
**Post date:** [May 13, 2020, 2:12am UTC](https://discuss.elastic.co/t/reflect-metadata-is-not-a-function/231856/3 "2020-05-13T02:12:44Z")

</div>

Hi Vignesh, As refering to the issue #70,i did not find any resloution to the issue which i have mentioned.Kindly share a sample code or step to over come the issue in angular 9

---

<div class="post-metadata">

**Author:** ![Daniele\_Renda](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/daniele_renda/32/39939_2.png) [@Daniele\_Renda](https://discuss.elastic.co/u/Daniele_Renda)\
**Post date:** [May 19, 2020, 8:56pm UTC](https://discuss.elastic.co/t/reflect-metadata-is-not-a-function/231856/4 "2020-05-19T20:56:17Z")

</div>

I solved following this suggestion: [https://stackoverflow.com/a/53791071/2012635](https://stackoverflow.com/a/53791071/2012635)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 9, 2020, 5:07pm UTC](https://discuss.elastic.co/t/reflect-metadata-is-not-a-function/231856/5 "2020-06-09T17:07:30Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
