nuxt-modules / logrocket Goto Github PK
View Code? Open in Web Editor NEWLogRocket module for Nuxt
License: MIT License
LogRocket module for Nuxt
License: MIT License
I think you have to explicit import defineNuxtPlugin like you import Logrocket in the plugin
import { defineNuxtPlugin } from '#app'
Thank you for providing nuxt-logrocket.
Can you add TypeScript support?
I have defined my own in my application as follows. I hope you can support ours officially.
import LogRocket from 'logrocket'
declare module '@nuxt/vue-app' {
interface Context {
$logrocket: typeof LogRocket
}
interface NuxtAppOptions {
$logrocket: typeof LogRocket
}
}
// Nuxt 2.9+
declare module '@nuxt/types' {
interface Context {
$logrocket: typeof LogRocket
}
interface NuxtAppOptions {
$logrocket: typeof LogRocket
}
}
declare module 'vue/types/vue' {
interface Vue {
$logrocket: typeof LogRocket
}
}
Giving this a try in my nuxt 3 setup, and I get the following when I run "pnpm build":
[vite]: Rollup failed to resolve import "/workspaces/trash/guis/web/node_modules/nuxt-logrocket/dist/runtime/plugin.client.ts" from "virtual:nuxt:/workspaces/trash/guis/web/.nuxt/plugins/client.mjs".
I have the same problem using npm instead of pnpm.
Looking at the directory, I have plugin.client.d.ts
and plugin.client.mjs
, but no plugin.client.ts
.
Can you add support for detecting @nuxtjs/sentry
and automatically add the LogRocket URL to sentry?
Here is the docs on how to get & add the url https://docs.logrocket.com/docs/sentry
this.$sentry
is the sentry variable to append the url.
Thanks for this plugin!
I'm trying to get the URL of the session so I can deal with it accordingly. Looks like when I tried to call it (eg: from the created
lifecycle), LogRocket hasn't be initialized then? Am curious how you would call it and when?
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
Hello everyone.
There is a build error in version 1.5.0.
It does not occur when downgrading to 1.4.0.
> nuxt-ts build
FATAL Cannot convert undefined or null to object 13:14:00
at Function.keys (<anonymous>)
at getKeys (node_modules/deepmerge/dist/cjs.js:61:16)
at mergeObject (node_modules/deepmerge/dist/cjs.js:86:2)
at deepmerge (node_modules/deepmerge/dist/cjs.js:117:10)
at ModuleContainer.module (node_modules/nuxt-logrocket/lib/module.js:5:19)
at ModuleContainer.addModule (node_modules/@nuxt/core/dist/core.js:235:34)
at node_modules/@nuxt/utils/dist/utils.js:1846:43
at ModuleContainer.ready (node_modules/@nuxt/core/dist/core.js:55:5)
at Nuxt._init (node_modules/@nuxt/core/dist/core.js:715:5)
╭───────────────────────────────────────────────────────────╮
│ │
│ ✖ Nuxt Fatal Error │
│ │
│ TypeError: Cannot convert undefined or null to object │
│ │
╰───────────────────────────────────────────────────────────╯
Do you know how to deal with it?
I followed the guide exactly from here https://nuxt.com/modules/logrocket
my node version is : 16.20.0
my nuxt version is 3.3.1
my nuxt-logrocket version is 2.0.6
nuxt.config.ts
modules: [
'nuxt-logrocket',
]
...
logRocket: {
id: `NUXT_LOG_ROW`,
dev: true
},
In my browser, i get the following error
caught SyntaxError: The requested module '/_nuxt/node_modules/.pnpm/[email protected]/node_modules/logrocket/dist/build.umd.js?v=d10ca332' does not provide an export named 'default' (at plugin.client.mjs:1:1)
Would be nice to support $config
for LOGROCKET_ID
, etc.
@nuxtjs/axios
has implemented it: https://github.com/nuxt-community/axios-module/blob/master/lib/plugin.js#L192-L198Error 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 /Users/lukaszflorczak/my-project/node_modules/.pnpm/[email protected][email protected]/node_modules/nuxt-logrocket/dist/module.mjs
There are hardcoded paths In module.d.ts
:
export * from "/home/farzad/projects/oss/nuxt-logrocket/src/module";
export { default } from "/home/farzad/projects/oss/nuxt-logrocket/src/module";
and module.mjs
:
import jiti from "file:///home/farzad/projects/oss/nuxt-logrocket/node_modules/jiti/lib/index.js";
/** @type {import("/home/farzad/projects/oss/nuxt-logrocket/src/module")} */
const _module = jiti(null, { interopDefault: true, esmResolve: true })("/home/farzad/projects/oss/nuxt-logrocket/src/module.ts");
export default _module;
Hey @farzadso 👋
Just wanted to give you a heads-up that we've migrated your repo to the new organisation nuxt-modules
. This organization is meant for modules that explicitly support Nuxt 3.
Let me know if you have any questions, otherwise thanks for your hard work!
My deployed file is obfuscated,
So it's kinda mess in logrocket
How to use source map?
At the moment, logrocket is only disabled when you are in dev mode.
It would be nice to able to set your own logic whether or not to enable logrocket.
Use case: I build a deploy preview on my server (that is: production mode), I want to test that specific deploy without logrocket recording it.
in nuxt.config.js:
modules: [
'nuxt-logrocket',
'@nuxtjs/axios'
],
logRocket: {
logRocketId: 'xxx/xxx',
devModeAllowed: true
},
I am unable to access the module from my vue files. The module doesn't seem to be injected. Am I missing something?
How can I ignore a specific mutation as described in https://docs.logrocket.com/docs/vuex-plugin?
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These problems occurred while renovating this repository. View logs.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
@nuxt/kit
, @nuxt/module-builder
, @nuxt/test-utils
, defu
, eslint
, nuxt
, vitest
)These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.
.circleci/config.yml
node 19.9.0
package.json
@nuxt/kit ^3.7.2
defu ^6.1.2
logrocket ^5.0.1
@nuxt/module-builder ^0.5.1
@nuxt/test-utils ^3.7.2
eslint ^8.49.0
nuxt ^3.7.2
standard-version ^9.3.2
vitest ^0.34.4
playground/package.json
I run multiple environments on my application. Most of the environments I deploy & test I do not want logrocket running.
Can you add a new option to control when isProduction
flag is true
where I could control this via nuxt.config.js
?
There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.
Error type: undefined. Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.
It appears that the only options available are the logrocket id and development mode. However, it could really benefit from being able to use textSanitizer
:
https://docs.logrocket.com/reference#dom
I am hoping you will tell me I am wrong and I am just missing something obviously.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.