Skip to content

fix: resolve dev startup issues for #35#36

Open
ankitkr104 wants to merge 2 commits into
StabilityNexus:mainfrom
ankitkr104:fix/issue-35-dev-startup-errors
Open

fix: resolve dev startup issues for #35#36
ankitkr104 wants to merge 2 commits into
StabilityNexus:mainfrom
ankitkr104:fix/issue-35-dev-startup-errors

Conversation

@ankitkr104
Copy link
Copy Markdown

@ankitkr104 ankitkr104 commented Mar 28, 2026

Summary

This PR fixes the setup and local development startup issues reported in #35.

During project setup, the app was showing multiple confusing errors and warnings, including missing Next.js chunk files, a broken favicon request, hydration warnings on the root layout, and noisy wallet SDK dependency resolution errors. Together, these made the local startup experience look broken even when parts of the app still rendered.

Closes #35.

Problem

While running the app locally with npm run dev, the following issues were observed:

  • /_next/static/chunks/... requests returning 404
  • /favicon.ico returning 500
  • hydration warning: Extra attributes from the server: class,style
  • bundler warnings from MetaMask / WalletConnect dependency resolution
  • inconsistent dev-server behavior caused by generated output conflicts

The main setup problem was that Next.js dev/build artifacts were conflicting with static export output, and the app also had a few missing or mismatched asset/config details that amplified the startup noise.

Root Cause

The issues came from a combination of small setup problems:

  • next.config.mjs was using a custom distDir: 'out' together with output: 'export'
  • the browser expected a favicon, but metadata did not explicitly point to the existing SVG asset
  • the navigation component referenced /logo.svg, which was not present in the repo
  • next-themes was mutating root attributes during hydration, triggering a warning on <html>
  • wallet-related packages referenced optional modules that are not required for this app’s browser setup, but Next still tried to resolve them during development

Result

After these changes, the local development experience is cleaner and more stable:

  • Next.js no longer mixes dev/build output with export output
  • favicon requests resolve correctly
  • the root hydration warning is suppressed appropriately
  • MetaMask / WalletConnect optional dependency warnings are reduced
  • setup errors are easier to distinguish from browser-extension noise

AI Usage Disclosure:

We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact. AI slop is strongly discouraged and may lead to banning and blocking. Do not spam our repos with AI slop.

Check one of the checkboxes below:

  • This PR does not contain AI-generated code at all.
  • This PR contains AI-generated code. I have read the AI Usage Policy and this PR complies with this policy. I have tested the code locally and I am responsible for it.

I have used the following AI models and tools: TODO

Checklist

  • My PR addresses a single issue, fixes a single bug or makes a single improvement.
  • My code follows the project's code style and conventions
  • If applicable, I have made corresponding changes or additions to the documentation
  • If applicable, I have made corresponding changes or additions to tests
  • My changes generate no new warnings or errors
  • I have joined the Discord server and I will share a link to this PR with the project maintainers there
  • I have read the Contribution Guidelines
  • Once I submit my PR, CodeRabbit AI will automatically review it and I will address CodeRabbit's comments.
  • I have filled this PR template completely and carefully, and I understand that my PR may be closed without review otherwise.

Summary by CodeRabbit

  • Chores
    • Updated application branding: navigation logo now displays stability.svg.
    • Updated favicon and device icons to stability.svg and apple-touch-icon across browsers and devices.
    • Optimized build configuration and module resolution to reduce unwanted bundles during builds.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7acf9743-0c89-42c2-b760-23d4783e5daf

📥 Commits

Reviewing files that changed from the base of the PR and between 458c202 and 0889c5c.

⛔ Files ignored due to path filters (1)
  • public/apple-touch-icon.png is excluded by !**/*.png
📒 Files selected for processing (1)
  • app/layout.tsx

📝 Walkthrough

Walkthrough

Added app icons to Next metadata, set suppressHydrationWarning on the root <html>, swapped the navigation logo to a new asset, removed distDir: 'out' from Next config, and added webpack aliases that map two optional packages to false.

Changes

Metadata & Hydration

Layer / File(s) Summary
Metadata shape and icon values
app/layout.tsx
Added metadata.icons with icon: '/stability.svg', shortcut: '/stability.svg', and apple: '/apple-touch-icon.png'.
Root HTML attribute
app/layout.tsx
Updated root <html> from <html lang='en'> to <html lang='en' suppressHydrationWarning> to suppress hydration mismatch warnings.

Navigation Branding

Layer / File(s) Summary
Navigation logo swap
components/navigation.tsx
Replaced PillNav logo prop from "/logo.svg" to "/stability.svg" (asset path change only).

Build Configuration & Module Resolution

Layer / File(s) Summary
Next config: output and webpack aliases
next.config.mjs
Removed distDir: 'out'. Added webpack hook ensuring config.resolve.alias exists and setting aliases: '@react-native-async-storage/async-storage': false and 'pino-pretty': false to prevent bundling those optional packages.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I found new icons in the sun,
A stability sprite for everyone,
The html hushes its warning song,
Webpack skips what doesn't belong,
The nav dons a brand-new face — hop along!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main objective of the PR—fixing dev startup issues referenced in issue #35.
Linked Issues check ✅ Passed The PR changes directly address all five coding objectives from issue #35: removing distDir conflict (chunk 404s), fixing favicon metadata (favicon 500), suppressing hydration warnings, reducing optional dependency warnings, and stabilizing dev-server behavior.
Out of Scope Changes check ✅ Passed All changes in the PR are directly scoped to resolving the specific issues outlined in #35; no unrelated modifications are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
next.config.mjs (1)

10-20: Scoping optional-module aliases to client builds is a best practice, though risk is minimal here.

These modules (@react-native-async-storage/async-storage and pino-pretty) are not directly imported in application code—they appear only in dependency metadata as optional peer dependencies. However, scoping aliases with !isServer remains cleaner and prevents accidental transitive masking on the server side.

Suggested adjustment
-  webpack: (config) => {
+  webpack: (config, { isServer }) => {
     config.resolve ??= {}
     config.resolve.alias ??= {}

-    Object.assign(config.resolve.alias, {
-      '@react-native-async-storage/async-storage': false,
-      'pino-pretty': false,
-    })
+    if (!isServer) {
+      Object.assign(config.resolve.alias, {
+        '@react-native-async-storage/async-storage': false,
+        'pino-pretty': false,
+      })
+    }

     return config
   },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@next.config.mjs` around lines 10 - 20, The webpack config currently
unconditionally sets config.resolve.alias for
'@react-native-async-storage/async-storage' and 'pino-pretty'; change the
webpack function signature to accept the build context (webpack: (config, {
isServer }) => { ... }) and only assign those optional-module aliases when
!isServer (i.e., wrap the Object.assign(config.resolve.alias, {...}) call in if
(!isServer) { ... }), keeping the same config.resolve and alias keys to avoid
masking server-side resolution.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@app/layout.tsx`:
- Around line 16-20: The metadata icons object currently sets apple to an SVG
which iOS doesn't support; update the icons.apple value (in the exported
metadata/icons object) from '/stability.svg' to a PNG (e.g. '/stability.png'),
keep icons.icon and icons.shortcut as SVG, and ensure the corresponding PNG
asset is present in your public/static assets.

---

Nitpick comments:
In `@next.config.mjs`:
- Around line 10-20: The webpack config currently unconditionally sets
config.resolve.alias for '@react-native-async-storage/async-storage' and
'pino-pretty'; change the webpack function signature to accept the build context
(webpack: (config, { isServer }) => { ... }) and only assign those
optional-module aliases when !isServer (i.e., wrap the
Object.assign(config.resolve.alias, {...}) call in if (!isServer) { ... }),
keeping the same config.resolve and alias keys to avoid masking server-side
resolution.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cb2e1ce8-e185-4ef0-b908-d54b9be45bf0

📥 Commits

Reviewing files that changed from the base of the PR and between bb0bf2b and 458c202.

📒 Files selected for processing (3)
  • app/layout.tsx
  • components/navigation.tsx
  • next.config.mjs

Comment thread app/layout.tsx
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]: Setup/dev startup shows chunk 404s, favicon 500, hydration warning, and MetaMask optional dependency resolution errors

1 participant