# Can't use @elastic/apm-rum-core with Angularjs

**URL:** <https://discuss.elastic.co/t/cant-use-elastic-apm-rum-core-with-angularjs/226655>\
**Category:** APM\
**Tags:** rum\
**Created:** [April 6, 2020, 9:09am UTC](https://discuss.elastic.co/t/cant-use-elastic-apm-rum-core-with-angularjs/226655 "2020-04-06T09:09:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![akosanovic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akosanovic/32/58345_2.png) [@akosanovic](https://discuss.elastic.co/u/akosanovic)\
**Post date:** [April 6, 2020, 9:09am UTC](https://discuss.elastic.co/t/cant-use-elastic-apm-rum-core-with-angularjs/226655/1 "2020-04-06T09:09:05Z")

</div>

I'm getting build error when trying to use `@elastic/apm-rum-core 5.0.0 ` with Angularjs. There is also an issue with `@elastic/apm-rum-core 4.0.0 `

**Kibana version** : 7.5.0

**Elasticsearch version** :7.5.0

**APM Server version** : 7.5.0

**Is there anything special in your setup?**  
_package.json_

```auto
 "@uirouter/angularjs": "~0.3.0",
  "angular": "~1.7.*",

```

_webpack.config.js_

```auto
  resolve: {
    extensions: ['.ts', '.js', '.css'],
    modules: [
      path.resolve('./src'),
      path.resolve('./src/components'),
      path.resolve('./src/common/directives'),
      path.resolve('./src/common/components'),
      path.resolve('./node_modules')
    ]
  },
  optimization: {
    splitChunks: {
     cacheGroups: {
        vendor: {
          chunks: 'all',
          name: 'vendor',
          test: /[\\/]node_modules[\\/]/,
          filename: 'js/vendor.[hash].js',
          enforce: true
        },
      },
    },
  },

```

**Provide logs and/or server output (if relevant)**:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/7/f7cd6826a4df6c020df920a39f392fa9925cbf71.png)

Is there a way to use `@elastic/apm-rum-core` with Angularjs?

---

<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:** [April 6, 2020, 9:23am UTC](https://discuss.elastic.co/t/cant-use-elastic-apm-rum-core-with-angularjs/226655/2 "2020-04-06T09:23:26Z")

</div>

Hi @akosanovic,

I am not sure not you ended up with a version of `@elastic/apm-rum-core` that is not released yet. Because we recently removed the package `uuid/lib/rng-browser` and rolled our own to reduce bundle size which is part of this PR - [https://github.com/elastic/apm-agent-rum-js/pull/705](https://github.com/elastic/apm-agent-rum-js/pull/705)

But as I mentioned, we have not released it yet so this issue is heavily unlikely to see it. Could you please have a look at the setup and check what version of `@elastic/apm-rum-core` and `@elastic/apm-rum-angular` you are using? I feel like this might be a symlink issue or using master branch instead.

Please do let me know what you see in your lockfiles as well.

Thanks,  
Vignesh

---

<div class="post-metadata">

**Author:** ![akosanovic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akosanovic/32/58345_2.png) [@akosanovic](https://discuss.elastic.co/u/akosanovic)\
**Post date:** [April 6, 2020, 9:55am UTC](https://discuss.elastic.co/t/cant-use-elastic-apm-rum-core-with-angularjs/226655/3 "2020-04-06T09:55:41Z")

</div>

Hi @vigneshshanmugam,

Thank you for your response,

I'm not using `@elastic/apm-rum-angular` only `apm-rum-core` as there is no support for AngularJS framework

> Only use this package if you want to implement integration for a framework that Elastic APM does not support yet.

> **[@elastic/apm-rum-core](https://www.npmjs.com/package/@elastic/apm-rum-core)**
>
> Elastic apm core. Latest version: 5.20.0, last published: 2 months ago. Start using @elastic/apm-rum-core in your project by running \`npm i @elastic/apm-rum-core\`. There are 3 other projects in the npm registry using @elastic/apm-rum-core.

And `npm i @elastic/apm-rum` is giving me a loader error which doesn't exist normally

```auto
ERROR in ./src/sass/app.scss (./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/lib/loader.js!./src/sass/app.scss)

```

---

<div class="post-metadata">

**Author:** ![vigneshh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vigneshh/32/35767_2.png) [@vigneshh](https://discuss.elastic.co/u/vigneshh)\
**Post date:** [April 6, 2020, 12:39pm UTC](https://discuss.elastic.co/t/cant-use-elastic-apm-rum-core-with-angularjs/226655/4 "2020-04-06T12:39:01Z")

</div>

@akosanovic

We do have an integration with Angular [Angular integration | APM Real User Monitoring JavaScript Agent Reference [5.x] | Elastic](https://www.elastic.co/guide/en/apm/agent/rum-js/current/angular-integration.html). Not for the old AngularJS though.

> And `npm i @elastic/apm-rum` is giving me a loader error which doesn't exist normally

This error does not seem to be coming from the package, Instead its from your application.

Could you see whether `@elastic/apm-rum-core` package is depending on `uuid/lib/rng-browser` in your `node_modules` directory?

Thanks,  
Vignesh

---

<div class="post-metadata">

**Author:** ![akosanovic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akosanovic/32/58345_2.png) [@akosanovic](https://discuss.elastic.co/u/akosanovic)\
**Post date:** [April 6, 2020, 1:04pm UTC](https://discuss.elastic.co/t/cant-use-elastic-apm-rum-core-with-angularjs/226655/5 "2020-04-06T13:04:40Z")

</div>

Hi @vigneshh,

`stic/apm-rum-core` has uuid dependency but not `uuid/lib/rng-browser` specifically

_package-lock.json_

```auto
    "@elastic/apm-rum": {
      "version": "5.0.0",
      "resolved": "https://registry.npmjs.org/@elastic/apm-rum/-/apm-rum-5.0.0.tgz",
      "integrity": "sha512-O2jay9qS5nzeYrGN4vdC1aH939CVgxxAY6wza4M35xTqqQ9xsEiVeyagaiDHbeT/vlzJDGPxFCIUg87qV4a7oA==",
      "requires": {
        "@elastic/apm-rum-core": "^5.0.0"
      }
    },
    "@elastic/apm-rum-core": {
      "version": "5.0.0",
      "resolved": "https://registry.npmjs.org/@elastic/apm-rum-core/-/apm-rum-core-5.0.0.tgz",
      "integrity": "sha512-BQ4kiGQTdAL+F0ssPUWn9jgXuJDKMyqFyA7R8f+2cvX6Kd6yUZqs/MpMtEGvTNov1jRle0IGhfjg/uXN9zPQ6Q==",
      "requires": {
        "error-stack-parser": "^1.3.5",
        "opentracing": "^0.14.3",
        "promise-polyfill": "^8.1.3",
        "uuid": "^3.1.0"
      },
      "dependencies": {
        "uuid": {
          "version": "3.4.0",
          "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
          "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A=="
        }
      }
    },

```

---

<div class="post-metadata">

**Author:** ![vigneshh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vigneshh/32/35767_2.png) [@vigneshh](https://discuss.elastic.co/u/vigneshh)\
**Post date:** [April 6, 2020, 1:29pm UTC](https://discuss.elastic.co/t/cant-use-elastic-apm-rum-core-with-angularjs/226655/6 "2020-04-06T13:29:44Z")

</div>

@akosanovic

That indeed seems to be correct. Can you force reinstall and try webpack build again? I tried installing 5.0.0 version myself in a new project and it seems to work as expected.

If it still exists, Could you create a test repository and point me to it. Would be easier to figure out whats happening.

Thanks,  
Vignesh

---

<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:** [April 27, 2020, 9:29am UTC](https://discuss.elastic.co/t/cant-use-elastic-apm-rum-core-with-angularjs/226655/7 "2020-04-27T09:29:45Z")

</div>

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