Skip to content
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

[Next.js] Log a more useful warning than "Cannot initialize SDK with debug option using a non-debug bundle" when disableLogger: true #15031

Open
lforst opened this issue Jan 16, 2025 · 7 comments
Labels
Meta: Good First Issue Package: nextjs Issues related to the Sentry Nextjs SDK

Comments

@lforst
Copy link
Member

lforst commented Jan 16, 2025

Description

The great founder of Sentry was confused by this and I think with good reason. We should log something more descriptive.

@lforst
Copy link
Member Author

lforst commented Jan 16, 2025

@a-hariti maybe something for you to look at!

@timfish
Copy link
Collaborator

timfish commented Jan 16, 2025

It might also be a nice addition to only strip debug messages in production builds. I can't think of a reason why you'd want to do this in dev mode.

@lforst lforst added the Package: nextjs Issues related to the Sentry Nextjs SDK label Jan 16, 2025
@a-hariti
Copy link
Collaborator

so what's the ideal DX in your opinion @timfish ?

@timfish
Copy link
Collaborator

timfish commented Jan 16, 2025

In an ideal world, users shouldn't need to think about this 🤔

I think it would be improved a lot if we:

  • Never strip debug messages in development mode
  • Log a more helpful next.js specific message when debug is enabled in production mode

If I'm being picky, I'm not a huge fan of disableLogging as an option name. It's not describing what it does and negative options always make me think twice about what they're actually doing. What does disableLogging: false do? It does not enable logging!

Something like stripDebugMessagesFromProductionBundle is laughably long but also descriptive of what it's actually doing.

@lforst
Copy link
Member Author

lforst commented Jan 16, 2025

If I'm being picky, I'm not a huge fan of disableLogging as an option name.

I had the same thought and I was the genius coming up with that name.

@timfish
Copy link
Collaborator

timfish commented Jan 22, 2025

Do we need to change anything here before v9?

If we change disableLogging it is probably used enough that we'd need to deprecate it for v9 and remove it in V10?

@lforst
Copy link
Member Author

lforst commented Jan 22, 2025

Don't think so. Changing the option name will not make it into v9 in any case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Meta: Good First Issue Package: nextjs Issues related to the Sentry Nextjs SDK
Projects
None yet
Development

No branches or pull requests

3 participants