refactor: guard console.error calls behind DEV environment check - #232
Merged
khanirfan18 merged 2 commits intoJul 16, 2026
Merged
Conversation
👷 Deploy request for finnboard0 pending review.Visit the deploys page to approve it
|
✅ Deploy Preview for finnboard ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Owner
|
@bh462007 fix conflicts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issue
Closes #212
Summary
This PR updates the context files to ensure
console.error()is only executed during development. The logs are now wrapped withimport.meta.env.DEV, preventing unnecessary error output in production while keeping the same debugging experience during local development.Changes
src/context/AppContext.jsxconsole.errorcall in the exchange rates fetch.catch()block.console.errorcall in the SupabaseloadDatacatch block.src/context/AuthContext.jsxconsole.errorcall in theloadSessioncatch block.console.errorcall in thesignOuterror handling block.console.errorcall in thesignOutcatch block.What Stayed the Same
setAuthError,setSession(null),return false, etc.).Implementation
Before:
After:
import.meta.env.DEVis Vite's built-in environment flag. It evaluates totruewhile running the development server andfalsein production builds, so console error logs are automatically omitted from production.Type of Change