Skip to content

fix: exclude React Native from browser %c gate#306

Merged
HugoRCD merged 2 commits intoHugoRCD:mainfrom
shubh73:fix/react-native-pretty-print-detection
Apr 27, 2026
Merged

fix: exclude React Native from browser %c gate#306
HugoRCD merged 2 commits intoHugoRCD:mainfrom
shubh73:fix/react-native-pretty-print-detection

Conversation

@shubh73
Copy link
Copy Markdown
Contributor

@shubh73 shubh73 commented Apr 26, 2026

📚 Description

isClient() (typeof window !== 'undefined') is used to gate %c console formatting, but React Native polyfills window, so the logger takes the browser branch and metro renders the format string and CSS args as literal text on every log.

Adds an isBrowser() helper (window + document + non–React Native navigator.product and routes the two %c gates.

isClient() / isServer() are unchanged — they remain a typeof window inverse pair, so existing consumers keep their semantics.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 26, 2026

Deployment failed with the following error:

There is no GitHub account connected to this Vercel account.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 26, 2026

@shubh73 is attempting to deploy a commit to the HRCD Projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the bug Something isn't working label Apr 26, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 26, 2026

Thank you for following the naming conventions! 🙏

@autofix-troubleshooter
Copy link
Copy Markdown

Hi! I'm the autofix logoautofix.ci troubleshooter bot.

It looks like you correctly set up a CI job that uses the autofix.ci GitHub Action, but the autofix.ci GitHub App has not been installed for this repository. This means that autofix.ci unfortunately does not have the permissions to fix this pull request. If you are the repository owner, please install the app and then restart the CI workflow! 😃

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 26, 2026

npm i https://pkg.pr.new/evlog@306
npm i https://pkg.pr.new/@evlog/nuxthub@306

commit: 4966be8

@HugoRCD HugoRCD changed the title fix(logger): exclude React Native from browser %c gate fix: exclude React Native from browser %c gate Apr 27, 2026
@HugoRCD HugoRCD merged commit 570d675 into HugoRCD:main Apr 27, 2026
9 of 11 checks passed
@shubh73 shubh73 deleted the fix/react-native-pretty-print-detection branch April 28, 2026 04:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants