gwomacks / php-debug

Atom Text Editor package for PHP debugging
MIT License
119 stars 31 forks source link

Uncaught TypeError: other.getPath is not a function #251

Closed aurovrata closed 6 years ago

aurovrata commented 6 years ago

I keep getting this error if I try to setup more than one breakpoint.

The first bp is registered and xdbug works fine. If I try to add another bp I get this error, Uncaught TypeError: other.getPath is not a function

aurovrata commented 6 years ago

in fact, I can remove the working bp and then add one elsewhere and it works again, but as soon as I try to add another bp, the error pops up again

cchamplin commented 6 years ago

Can you check if this is resolved in 0.2.6?

aurovrata commented 6 years ago

no, still an issue. I am on a linux machine,

php v7.0
$ atom --version
Atom    : 1.22.1
Electron: 1.6.15
Chrome  : 56.0.2924.87
Node    : 7.4.0
php-debug v0.2.6
stack trace:
~/.atom/packages/php-debug/lib/models/breakpoint.coffee:95
Hide Stack Trace
TypeError: other.getPath is not a function
    at Breakpoint.module.exports.Breakpoint.isEqual (~/.atom/packages/php-debug/lib/models/breakpoint.coffee:95:27)
    at Object.exports.arraySearch (~/.atom/packages/php-debug/lib/helpers.coffee:32:15)
    at Object.exports.arrayRemove (~/.atom/packages/php-debug/lib/helpers.coffee:37:19)
    at GlobalContext.module.exports.GlobalContext.removeBreakpoint (~/.atom/packages/php-debug/lib/models/global-context.coffee:44:23)
    at Object.toggleBreakpoint (~/.atom/packages/php-debug/lib/php-debug.coffee:492:30)
    at HTMLDivElement.<anonymous> (~/.atom/packages/php-debug/lib/php-debug.coffee:408:8)
    at HTMLDivElement.dispatch (~/.atom/packages/php-debug/node_modules/jquery/dist/jquery.js:4435:9)
    at HTMLDivElement.elemData.handle (~/.atom/packages/php-debug/node_modules/jquery/dist/jquery.js:4121:28)
cchamplin commented 6 years ago

This is fairly odd, what you're describing shouldn't really be possible (there are specific code checks for it). I'm wondering if it's possibly some type of data corruption in the local storage for the plugin. We might have to try a few things.

Can you clear all breakpoints via Packages->PHP Debug->Clear All Breakpoints, then restart Atom. Let me know if that fixes it.

AyeAyePhyuKyaw commented 6 years ago

If you install wordpress-suite 1.2.1 package, you face "TypeError: other.getPath is not a function" error and cannot toggle more than one breakpoint. I also faced same error. I solved it by disable wordpress-site 1.2.1.

I hope you will be ok.

aurovrata commented 6 years ago

@AyeAyePhyuKyaw bingo, had to remove the package altogether to get the bp to work.

cchamplin commented 6 years ago

Should be fixed in v0.3.0