nuxt-modules / logrocket

LogRocket module for Nuxt
MIT License
143 stars 13 forks source link

ERR_MODULE_NOT_FOUND when launching nuxt dev server #331

Closed chrisnoden closed 1 year ago

chrisnoden commented 1 year ago

I've followed the instructions and as soon as I add 'nuxt-logrocket' to my modules list I get an error and am unable to start my dev server:

Error while requiring module nuxt-logrocket: Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/farzad/projects/oss/nuxt-logrocket/node_modules/jiti/lib/index.js' imported from PROJECT_PATH/node_modules/nuxt-logrocket/dist/module.mjs'

(I've replaced the full path above)

Also below the above error, a similar

Cannot find module '/home/farzad/projects/oss/nuxt-logrocket/node_modules/jiti/lib/index.js' imported from ...

As you can see, it's trying to load them from a local /home directory - implying a compilation or similar problem when you've built the distribution.

nuxt cannot start as a result

julio-soft commented 1 year ago

I have the same error.

russback commented 1 year ago

Same here: nuxt 3.2.2, nuxt-logrocket 2.0.4. Reported on #327

chrisnoden commented 1 year ago

I've got LogRocket working just fine without this module:

Install LogRocket: yarn add logrocket (or equivalent)

Add LR to app.vue (so it's available on all your pages):

<script setup>
import LogRocket from 'logrocket';
LogRocket.init('your LR app ID');
</script>

I'm obviously using the composition API above, but this should work in Options API or in the other way of implementing setup() - but I don't use either of those.

LR works really well and is simple. Remember it takes a good few minutes for a session to appear - so if you test, go and make a brew before checking on the LR dashboard.

whydoyouwork commented 1 year ago

Ditto

Web3HackerWorld commented 1 year ago

Ditto

haigopi commented 1 year ago

Ditto

farzadso commented 1 year ago

Dupe: https://github.com/nuxt-community/nuxt-logrocket/issues/327