JulianMar / nuxt-bugsnag

Bugsnag module for nuxt.js
MIT License
49 stars 18 forks source link

No @bugsnag/plugin-vue installed #15

Closed Triloworld closed 4 years ago

Triloworld commented 4 years ago

Add as dependency for website - maybe note? or it can be somehow automated? It is in package but isn't picked up by plugin import Source of problem: https://github.com/JulianMar/nuxt-bugsnag/blob/29cc40ba99eb951f03f73aa7107ff07ea999f53a/lib/plugin.js#L3

I get this from module after installing myself: [bugsnag] Bugsnag.start() was called more than once. Ignoring.

Versions: "npm": "^6.14.5", "vue": "^2.6.11", "nuxt": "^2.12.2", "nuxt-bugsnag": "^4.1.0", "webpack": "^4.43.0", "webpack-dev-server": "^3.11.0"

JulianMar commented 4 years ago

Hi, so the plugin is installing correctly, you don't need to add the @bugsnag dependencies.

The was called more than once error is okay. It doesn't change the behaviour.

But after checking the docs I found that something is missing. After calling init you should do installVueErrorHandler(vue) like mentioned here https://docs.bugsnag.com/platforms/javascript/vue/.

After checking the example for nuxt.js from bugsnag they are themselves making this error.

Triloworld commented 4 years ago

I check this: https://docs.bugsnag.com/platforms/javascript/vue/ Probably in wrong place.

Bugsnag.start({
  apiKey: 'YOUR_API_KEY',
  plugins: [new BugsnagPluginVue()],
  otherOptions: value
})
JulianMar commented 4 years ago

check out this one https://github.com/bugsnag/bugsnag-js/blob/master/UPGRADING.md I forgot to follow the upgrade guide

Triloworld commented 4 years ago

Yeah! I see what you mention :)

JulianMar commented 4 years ago

I think PR #16 should fix both problems. I will test locally first

JulianMar commented 4 years ago

After looking through the source code of the bugsnag-vue plugin I noticed they are using the window object in there 🤦‍♂️ So no SSR support for that version, I will not change the syntax of the init yet.

But I have opened a issue with bugsnag here

Triloworld commented 4 years ago

Yep I tested and found that in context of browser it work (before export occur is placed). Thanks once more for help :)

JulianMar commented 4 years ago

Yes, just found out aswell!

So I check the CI and will release a bugfix version after that :)

Thanks for the report

JulianMar commented 4 years ago

Its live!