Blog (peerverity, /blog base path): community dropdown navigates to /blog/blog/trending/hive-… (404)
Environment
https://denser.discuss.peerverity.info/blog (Blog served under the /blog base path), Chrome 155, narrow viewport (~520 px, the layout where the community dropdown is shown), logged out, 2026-10-14.
Steps
- Open
/blogor/blog/trendingin a narrow window. - Open the community dropdown ("All posts" / "Wszystkie posty").
- Pick any community.
Actual
The app pushes a URL with the base path twice and shows "Page not found":
| Start page | Picked | URL after the pick |
|---|---|---|
| /blog | Splinterlands | /blog/blog/trending/hive-13323 |
| /blog | Actifit | /blog/blog/trending/hive-193552 |
| /blog | Worldmappin | /blog/blog/trending/hive-163772 |
| /blog/trending | Worldmappin | /blog/blog/trending/hive-163772 |
It is a client-side history.pushState (no reload), reproduced both by Adam and by script. The plain links to the same communities (sidebar "Trending Communities", post cards, /blog/communities) are correct (/blog/trending/hive-…), so in the wide layout the bug is not visible.
Expected
/blog/trending/hive-163772 (the community page).
Cause
apps/blog/features/layouts/communities-select.tsx, onValueChange (l. 57–63):
router.push(withBasePath('/communities'))
router.push(withBasePath(e))
router.push(withBasePath(`/trending/${e}`))withBasePath (packages/ui/lib/path-utils.ts) prepends /blog, and the Next router adds its own basePath again. Next's router.push expects paths without the base path; withBasePath belongs only in places that bypass the router (plain <a href>, window.location, absolute URLs). On deployments without a base path (blog.dev.openhive.network) withBasePath is a no-op, which is why it was not seen there.
Please also check
The same router.push/replace(withBasePath(...)) pattern exists in:
apps/blog/features/post-editor/hooks/use-post-form-actions.tsl. 171apps/blog/features/post-editor/PostPublishingSection.tsxl. 216
They may send the user to /blog/blog/... after publishing or editing a post (not tested).
Same dropdown, earlier bug: #884 (closed) (wrong URL for "My friends" / "My communities"). In this dropdown "My friends" and "My communities" are also hard-coded English strings.