-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Nuxt] Disable Sentry module by adding sentry.enabled
to Nuxt config
#14935
Comments
This came up already and I think it's a good idea. I'll put it in the backlog. |
sentry.enabled
to Nuxt config
A PR closing this issue has just been released 🚀This issue was referenced by PR #15337, which was included in the 8.55.0 release. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem Statement
Context
When running unit tests using the
defineVitestConfig
method from@nuxt/test-utils/config
package, it will read thenuxt.config.ts
file and setup the@sentry/nuxt
module if found in themodules
array.This causes the sentry vite plugin to boot and it logs warnings from sentry:
Note: the "No auth token provided" warning is because the environment variable I configured is not available in test mode.
Expected behaviour
I want to be able to disable the Sentry module during test mode, so I don't have these logs everytime I run the tests, and also because it seems like Sentry is gonna run along with my tests, which I don't really want.
A workaround I found is to conditionally add the module depending on the NODE_ENV variable:
Doing so, the module is not added and therefore not setup in my test environment.
Solution Brainstorm
Maybe simply an
enabled
configuration boolean on the module so we can opt-out conditionally?The text was updated successfully, but these errors were encountered: