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

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

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

webpack.config.js

  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

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

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

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

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.

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

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

@akosanovic

We do have an integration with Angular 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

Hi @vigneshh,

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

package-lock.json

    "@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=="
        }
      }
    },

@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

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