Error with ApmVuePlugin
See original GitHub issueI try to use the APM Real User Monitoring JavaScript Agent with Vue as how it is in https://www.elastic.co/guide/en/apm/agent/rum-js/master/vue-integration.html described.
My steps:
(1) npm install --save @elastic/apm-rum-vue
(2) my main.js
import { createApp } from 'vue'
import { ApmVuePlugin } from '@elastic/apm-rum-vue'
import App from './App.vue'
import router from './router'
createApp(App)
.use(router)
.use(ApmVuePlugin, {
router,
config: {
serviceName: 'app-name',
serverUrl: 'http://localhost:8200', // apm server
serviceVersion: ''
}
})
.mount('#app')
Error in Browser console appears:
Uncaught TypeError: Cannot set properties of undefined (setting '$apm')
at Object.install (webpack-internal:///./node_modules/@elastic/apm-rum-vue/dist/es/index.js:29)
at Object.use (webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:3091)
at eval (webpack-internal:///./src/main.js:22)
at Module../src/main.js (app.js:1312)
at __webpack_require__ (app.js:849)
at fn (app.js:151)
at Object.1 (app.js:1337)
at __webpack_require__ (app.js:849)
at checkDeferredModules (app.js:46)
at app.js:925
I can see also the error in my kibana apm dashboard
node -v => v12.16.1
npm -v => 7.6.3
my package.json
{
"name": "my-app",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"@elastic/apm-rum-vue": "^1.3.2",
"core-js": "^3.6.5",
"elastic-apm-node": "^3.26.0",
"vue": "^3.0.0",
"vue-router": "^4.0.0-0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-plugin-router": "^4.5.12",
"@vue/cli-service": "~4.5.0",
"@vue/compiler-sfc": "^3.0.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^7.0.0"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/vue3-essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Missing package installation (vue-router) · Issue #574 - GitHub
I'm following this reference to install APM Vue Package. When I just run npm install --save @elastic/apm-rum-vue , I can see below WARN...
Read more >APM Vue plugin - APM - Discuss the Elastic Stack
Hi everyone I'm new in the community (And in the use of APM RUM) I install APM vue plugin through yarn and I...
Read more >@elastic/apm-rum-vue - npm
Elastic APM Real User Monitoring for Vue applications. Latest version: 2.1.2, last published: 6 months ago. Start using @elastic/apm-rum-vue ...
Read more >VueJs how to remove global error handler for testing with vue ...
js: import { ApmVuePlugin } from '@elastic/apm-rum-vue';. This was reponsible for the duplicate Global error handler, deactivating it during ...
Read more >Extending TypeScript Type Definitions - Damir's Corner
router"; import { ApmVuePlugin } from "@elastic/apm-rum-vue"; ... However, the TypeScript compiler will throw the following error:.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Doing a small test internally, will release it next week. Apologies for the delay here.
1.4.x was released by mistkae with support for Vue 3, I have deprecated the version in favor of
2.0.0
For users of Vue 3, We have released @elastic/apm-rum-vue@2.x that supports it by default.
Please refer to the docs on the usage - https://www.elastic.co/guide/en/apm/agent/rum-js/current/vue-integration.html#vue-integration.
Thanks. Please do let us know if you run in to issues.