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

Fix devtools warning in CLI #2404

Closed
wants to merge 1 commit into from
Closed

Conversation

m-bp
Copy link

@m-bp m-bp commented Mar 12, 2024

Related Issues or Discussions

n/a

Summary

The warning always shows in the CLI. This fixes it.

Copy link

vercel bot commented Mar 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
zustand-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 12, 2024 9:43am

Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@dai-shi
Copy link
Member

dai-shi commented Mar 12, 2024

What's the problem of showing the warning? If it doesn't help much, we should remove it entirely.

@m-bp
Copy link
Author

m-bp commented Mar 12, 2024

It makes no sense to show a warning related to a browser extension in the node console. I don't think it's wrong to show it in the browser (redux does it, right?). I just don't want that message to show in my console every time Next.js renders a page.

@dai-shi
Copy link
Member

dai-shi commented Mar 12, 2024

in the node console.

Well, you don't need to use the middleware technically.

I don't think it's wrong

Does anyone else have good experience with the message in the browser?

@dai-shi
Copy link
Member

dai-shi commented Mar 12, 2024

I forgot that our solution provided now is enabled.

Please specify enabled: typeof window !== 'undefined'

@dai-shi dai-shi closed this Mar 12, 2024
@m-bp
Copy link
Author

m-bp commented Mar 12, 2024

But how does it make sense to check for a browser plugin when there's no browser? Before the enabled flag was added there was a window check. No one would ever use enabled: isDevelopment vs enabled: typeof window !== "undefined" && isDevelopment. I know I can circumvent this but there's no point in showing EVERYONE who uses the devtools a warning for no reason unless they specifically disable it.

@dai-shi
Copy link
Member

dai-shi commented Mar 12, 2024

I think we should consider removing the warning entirely, if the current solution doesn't fit well.
Can you modify the branch?

@m-bp m-bp mentioned this pull request Mar 12, 2024
@charkour charkour mentioned this pull request Apr 6, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants