Skip to content

Conversation

@ejscheepers
Copy link
Contributor

Problem

The database discovery modal was crashing in the browser with Uncaught TypeError: Cannot read
properties of null (reading 'filter') when opening for certain connections.

Root Cause

The Go backend was returning null instead of an empty array [] when no databases were found during
discovery. In Go, uninitialized slices (var databases []string) are nil, which serializes to null in
JSON responses, causing JavaScript to crash when calling .filter() on the result.

Solution

• Initialize all database slices as empty arrays ([]string{}) instead of nil slices in
discoverPostgresDatabases, discoverMySQLDatabases, and discoverMongoDBDatabases
• Added safety check in DiscoverDatabases to ensure nil is never returned

Impact

• Fixes browser crash when discovering databases
• Ensures consistent API responses (empty arrays instead of null)
• No frontend changes required - the TypeScript types already expected string[]

@vercel
Copy link

vercel bot commented Nov 20, 2025

@ejscheepers is attempting to deploy a commit to the Dendi Team on Vercel.

A member of the Team first needs to authorize it.

@ejscheepers
Copy link
Contributor Author

@dendianugerah I am trying to add Velld to Coolify and this was one of the reasons it was "rejected", would be awesome if we could get this checked and merged.

@dendianugerah
Copy link
Owner

lgtm, thanks!

@dendianugerah dendianugerah merged commit c7f4ef3 into dendianugerah:main Nov 25, 2025
2 of 3 checks passed
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