Back to DevLog

Fixed the ChunkLoadError from Hell and Built Some Sweet Admin Tools

3 min read

What a day! Started with a nasty ChunkLoadError that was making the app completely unusable, and ended up shipping a bunch of admin features that I've been putting off for weeks.

The ChunkLoadError Mystery

So the app was basically broken - users couldn't load any pages because of this cryptic ChunkLoadError. Turns out the root cause was pretty gnarly: Passenger was passing the full URL including the /relyo basePath to Node, but Next.js couldn't serve the /_next/static/ assets at /relyo/_next/.

The fix was updating server.js to strip /relyo from _next asset URLs and page routes (but NOT /api routes - those need the prefix for rewrites). Sometimes the simplest solutions are the hardest to find.

Wallet Issues and Auth Improvements

Fixed a weird bug where wallet balances were showing em dashes instead of actual numbers. Added JWT auto-refresh on 401 errors in api.ts - now when your token expires, it automatically hits /auth/refresh and retries the request. Much better UX.

Also tackled a 503 error in the currency bridge. The EclipseCP UnionBridgeController was trying to query a discord_id column that doesn't exist. Fixed it to use LinkedAccount where provider='discord' and synced the bridge token between environments.

New Admin Features

Built out two admin pages I've been meaning to get to:

Manage Listings (/admin/listings) - Now I can toggle featured/verified status for bots, servers, and reddit bots with proper audit logging. Added a generic toggleFlag() method to handle all the featured/verified toggling.

Tags CRUD (/admin/tags) - Full create/edit/delete functionality with usage counts, grouped by category. No more manually updating tags in the database!

Also added a featured servers section to the homepage with getFeaturedServers() and a nice FeaturedServerCard component.

UX Polish and Legal Stuff

Improved the BoostPanel by replacing that weird lightning emoji with a proper RelayIcon SVG and adding a "Get Relay" link when users don't have enough balance. Updated the boost page text to be clearer: "Boosts cost Relay, which you can purchase from the store".

Spent way too much time on legal pages, but they're all updated with proper Ridoco company details and the correct relyo-specific email addresses. Added terms acceptance text to both stores. Not the fun stuff, but necessary.

Infrastructure Wins

Cleaned up the server and freed about 1GB by removing old deploy zips. Fixed some cron duplication (had 3x schedule:run entries, now just 1).

Got the backend running persistently with nohup node dist/main.js and a @reboot cron entry. Also fixed Redis socket configuration for BullMQ - had to use path for Unix sockets instead of host+port.

What's Next

Still waiting on MultiSafePay approval now that legal pages are live. Reddit OAuth applications are submitted but there's a 7+ day wait. Want to add auto-fetching of server member counts via Discord's invite API.

The /relyo/ subpath is staying permanently due to DirectAdmin venv path conflicts - can't relocate to root without breaking things.

Feels good to knock out both critical bugs and those admin features that have been on my todo list forever. Sometimes you just need to buckle down and ship the boring stuff that makes everything else possible.

Share this post