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 : Uncaught Runtime Error Prevents Local Development #560

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

akash70629
Copy link
Contributor

@akash70629 akash70629 commented Nov 16, 2024

Description

After forking and cloning the repository, I encountered a major issue while setting up the local environment. Upon running npm install and npm start, I received an uncaught runtime error.

To resolve this, you can modify your code to handle the case where the stored theme is a simple string instead of a JSON string. Here's how you can do that:

Retrieving the theme: Instead of using JSON.parse, you directly retrieve the item from local storage.
Checking for storedTheme: If storedTheme is not null (meaning there is a value stored), it will return that value directly, which should be either "dark" or "light".
Fallback: If there’s no stored theme, it defaults to checking the document's class to determine the current theme.
This approach avoids any JSON parsing issues and should fix the "Unexpected token 'd'" error.

I fixed that.

Related Issues

Fixes : #489

Changes Proposed

Changed some line of code on Sidebar.jsx

Checklist

  • I have read and followed the Contribution Guidelines.
  • All new and existing tests passed.
  • I have updated the documentation to reflect the changes I've made.
  • My code follows the code style of this project.
  • The title of my pull request is a short description of the requested changes.

Screenshots

Before

record_000002.mp4

After

record_000003.mp4

Copy link

vercel bot commented Nov 16, 2024

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

Name Status Preview Comments Updated (UTC)
devdisplay ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 18, 2024 3:03pm

@akash70629
Copy link
Contributor Author

@madhukalita please review and merge the PR .

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.

🐞[Bug]: Uncaught Runtime Error Prevents Local Development
1 participant