Skip to content

fix: use hashrouter for vercel deployment compat#2040

Merged
shrugs merged 1 commit into
mainfrom
fix/example-app-hash-router
May 1, 2026
Merged

fix: use hashrouter for vercel deployment compat#2040
shrugs merged 1 commit into
mainfrom
fix/example-app-hash-router

Conversation

@shrugs
Copy link
Copy Markdown
Member

@shrugs shrugs commented May 1, 2026

simple hotfix for the example app

Copilot AI review requested due to automatic review settings May 1, 2026 20:24
@shrugs shrugs requested a review from a team as a code owner May 1, 2026 20:24
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ensnode-enskit-react-example Ready Ready Preview, Comment May 1, 2026 8:24pm
3 Skipped Deployments
Project Deployment Actions Updated (UTC)
admin.ensnode.io Skipped Skipped May 1, 2026 8:24pm
ensnode.io Skipped Skipped May 1, 2026 8:24pm
ensrainbow.io Skipped Skipped May 1, 2026 8:24pm

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 1, 2026

⚠️ No Changeset found

Latest commit: b1e9ddb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@shrugs shrugs merged commit f68ebbe into main May 1, 2026
19 of 20 checks passed
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 1, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: f0a38f5e-b396-47dc-a657-7fd00a659a75

📥 Commits

Reviewing files that changed from the base of the PR and between c3e3b63 and b1e9ddb.

📒 Files selected for processing (1)
  • examples/enskit-react-example/src/App.tsx

📝 Walkthrough

Walkthrough

The routing configuration in the example application is updated to use React Router's HashRouter instead of BrowserRouter. The import statement and component wrapper are changed accordingly, with all route definitions remaining unchanged.

Changes

Cohort / File(s) Summary
Router Configuration
examples/enskit-react-example/src/App.tsx
Switched from BrowserRouter to HashRouter for URL routing strategy, updating both the import and the wrapping component.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A hop skip and a hash redirect,
From browser paths we now collect,
The router's dressed in new attire,
Hash-based routes take us higher! ✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/example-app-hash-router

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
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

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

@shrugs shrugs deleted the fix/example-app-hash-router branch May 1, 2026 20:24
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 1, 2026

Greptile Summary

Replaces BrowserRouter with HashRouter in the enskit-react-example app so that deep-linked routes (e.g. /domain/:name) resolve correctly on Vercel's static hosting without requiring server-side rewrite rules. The fix works correctly for an example app, trading clean URL paths for zero-config deployment compatibility.

Confidence Score: 5/5

Safe to merge — minimal, correct one-file change to an example app.

Single import swap in an example app. HashRouter is the standard, zero-config solution for SPA routing on static hosts. No logic, no data, no security surface changed.

No files require special attention.

Important Files Changed

Filename Overview
examples/enskit-react-example/src/App.tsx Swaps BrowserRouter for HashRouter to fix 404s on direct navigation to sub-routes in Vercel static deployments; no logic changes.

Sequence Diagram

sequenceDiagram
    participant User
    participant Vercel
    participant App

    Note over User,App: Before (BrowserRouter)
    User->>Vercel: GET /domain/eth
    Vercel-->>User: 404 (no rewrite rule for SPA routes)

    Note over User,App: After (HashRouter)
    User->>Vercel: GET /#/domain/eth
    Vercel->>App: Serves index.html (root path always matches)
    App->>User: React Router reads hash, renders DomainView
Loading

Reviews (1): Last reviewed commit: "fix: use hashrouter for vercel deploymen..." | Re-trigger Greptile

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the enskit-react-example app’s routing strategy to work on static/Vercel deployments where server-side rewrites for client-side routes aren’t guaranteed.

Changes:

  • Replace BrowserRouter with HashRouter in the example app to ensure deep links (e.g. /domain/...) load correctly on Vercel.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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