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

**URL:** <https://community.localwp.com/t/typeerror-cannot-convert-undefined-or-null-to-object-at-objec-entries/50111>\
**Category:** Support\
**Created:** [May 12, 2025, 2:09am UTC](https://community.localwp.com/t/typeerror-cannot-convert-undefined-or-null-to-object-at-objec-entries/50111 "2025-05-12T02:09:16Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![wendybreaksout](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/wendybreaksout/32/19078_2.png) [@wendybreaksout](https://community.localwp.com/u/wendybreaksout)\
**Post date:** [May 12, 2025, 2:09am UTC](https://community.localwp.com/t/typeerror-cannot-convert-undefined-or-null-to-object-at-objec-entries/50111/1 "2025-05-12T02:09:16Z")

</div>

### 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](https://localwp.com/help-docs/troubleshooting/retrieving-locals-log-file/))  
[local-logs.zip](https://community.localwp.com/uploads/short-url/z8AgZRXoLNzdydEPtqGJZW6tbC9.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.

---

<div class="post-metadata">

**Author:** ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)\
**Post date:** [May 12, 2025, 1:26pm UTC](https://community.localwp.com/t/typeerror-cannot-convert-undefined-or-null-to-object-at-objec-entries/50111/2 "2025-05-12T13:26:25Z")

</div>

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](https://localwp.com/help-docs/getting-started/how-to-import-a-wordpress-site-into-local/#restore-local-site-from-site-files)

---

<div class="post-metadata">

**Author:** ![wendybreaksout](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/wendybreaksout/32/19078_2.png) [@wendybreaksout](https://community.localwp.com/u/wendybreaksout)\
**Post date:** [May 12, 2025, 4:59pm UTC](https://community.localwp.com/t/typeerror-cannot-convert-undefined-or-null-to-object-at-objec-entries/50111/3 "2025-05-12T16:59:17Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)\
**Post date:** [May 13, 2025, 1:03pm UTC](https://community.localwp.com/t/typeerror-cannot-convert-undefined-or-null-to-object-at-objec-entries/50111/4 "2025-05-13T13:03:54Z")

</div>

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

> [@Local is becoming unusable for me](https://community.localwp.com/t/local-is-becoming-unusable-for-me/50141/2):
>
> Hi @robdobson I think you’re running into a few different issues here that might all be fixed by doing a full uninstall and reinstall. In order to refresh here and start with a clean slate could you give the below troubleshooting steps a try? Export any sites that you have on Local and save them to a folder somewhere on your computer: [Backup a Local Site - Local](https://localwp.com/help-docs/getting-started/how-to-backup-a-local-site/) Fully uninstall Local from your computer using the MacOS steps here: [Uninstall Local - Local](https://localwp.com/help-docs/troubleshooting/uninstalling-local/) Install the latest version of Lo…

---

<div class="post-metadata">

**Author:** ![wendybreaksout](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/wendybreaksout/32/19078_2.png) [@wendybreaksout](https://community.localwp.com/u/wendybreaksout)\
**Post date:** [May 16, 2025, 12:53am UTC](https://community.localwp.com/t/typeerror-cannot-convert-undefined-or-null-to-object-at-objec-entries/50111/5 "2025-05-16T00:53:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)\
**Post date:** [May 16, 2025, 1:02pm UTC](https://community.localwp.com/t/typeerror-cannot-convert-undefined-or-null-to-object-at-objec-entries/50111/6 "2025-05-16T13:02:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/system/32/1_2.png) [@system](https://community.localwp.com/u/system)\
**Post date:** [May 18, 2025, 1:02am UTC](https://community.localwp.com/t/typeerror-cannot-convert-undefined-or-null-to-object-at-objec-entries/50111/7 "2025-05-18T01:02:39Z")

</div>

Closed on May 18, 2025, 1:02am UTC

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