TypeError: Cannot convert undefined or null to object at Objec.entries

What issue or error are you experiencing?

When I try to turn on Xdebug, the site fails to restart. The following stacktrace is displayed in a popup dialog along with the “Uh oh!” message:

TypeError: Cannot convert undefined or null to object

at Object.entries ()

at PortsService. (/Applications/Local.app/Contents/Resources/app.asar/main/sites/PortsService.js:107:62)

at Generator.next ()

at /Applications/Local.app/Contents/Resources/app.asar/main/sites/PortsService.js:8:71

at new Promise ()

at __awaiter (/Applications/Local.app/Contents/Resources/app.asar/main/sites/PortsService.js:4:12)

at PortsService.checkAndReplaceUnavailablePorts (/Applications/Local.app/Contents/Resources/app.asar/main/sites/PortsService.js:101:16)

at SiteProcessManagerService. (/Applications/Local.app/Contents/Resources/app.asar/main/sites/SiteProcessManagerService.js:272:57)

at Generator.next ()

at fulfilled (/Applications/Local.app/Contents/Resources/app.asar/main/sites/SiteProcessManagerService.js:5:58)

What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc

Create a new site.
Try to enable the Xdebug with the switch provided.


System Details

  • Local Version:
    Version 9.2.4+6788

  • Operating System (OS) and OS version:
    Mac OS Sequoia 15.4.1


Local Logs

Attach your Local Logs here (Help Doc - Retrieving Local’s Log)
local-logs.zip (1.3 MB)


Security Reminder
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.

Hi @wendybreaksout

If you create a new, blank site in Local can you access that okay? If you can, then you may want to try reimporting the site getting the errors. The steps would look like this:

  • Locate the site files on your machine, and save a copy of them to your desktop. If you click Go to Site Folder under your site name it should take you right to where they are located.
  • Once you have those copied, completely delete the site from Local
  • Restart Local/your machine
  • Reimport the site back into Local. You can refer here on how to Restore from only Local site files

Thank you. The problem even occurs when I create a new blank site. The site works until I try to enable Xdebug via the Local UI. The problem started after I attempted to pull the database plus theme and plugin folders from one of my sites on WP Engine to my instance of it in Local. It seems like a global Local configuration file got clobbered somehow.

Would you be able to try some full uninstall and reinstall steps like I shared here to see if that fixes things up?

Thank you. Barring an underlying OS/hardware issue, that had to work and it did.

1 Like

Glad to hear it @wendybreaksout! Thank you for following up and letting us know :green_heart:

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.