JulianMar / nuxt-bugsnag

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

Cannot find module nuxt-bugsnag/dist/module.cjs when trying to install #32

Closed dritter closed 2 years ago

dritter commented 2 years ago

Hi Julian,

when trying to install this repo after a fresh clone, I get the following error:

image

I use node v18.6.0 and npm 8.15.0 on Linux.

JulianMar commented 2 years ago

Hey Dominik, thanks for using the package. Which nuxt version are you using?

dritter commented 2 years ago

Ha! I knew I forgot to mention a Version :D

image

JulianMar commented 2 years ago

Ahh you just checked out the project, interesting You want to improve something?

But you are right it fails. Very weird, even with node 16 I need to check it in my free time

dritter commented 2 years ago

You want to improve something?

Not yet. ;) TBH, we have a similar error when using nuxt-bugsnag in one of our projects, which I wanted to fix: image

And plugin.mjs:2 points at: image

dritter commented 2 years ago

Okay. At least I figured out my problem. I needed to tell vite (in the nuxt.config.js) to optimize @bugsnag/plugin-vue:

vite: {
    optimizeDeps: {
      include: [
        "@bugsnag/plugin-vue"
      ]
    }
}

Source: https://github.com/vitejs/vite/issues/5566

JulianMar commented 2 years ago

Ohhh wow, thanks for finding it out! I will adapt the package to include it

I will read up on it and release a fix tomorrow or the day after.

JulianMar commented 2 years ago

Thanks for your help! The fix should be released as version 5.5.1 :)