mbolotov / intellij-cypress

IntelliJ-Cypress plugin: https://plugins.jetbrains.com/plugin/13819-intellij-cypress Pro version: https://plugins.jetbrains.com/plugin/13987-cypress-support-pro
MIT License
35 stars 5 forks source link

Debugger on Pro Version does not stop on my breakpoints #113

Closed Gardosen closed 1 year ago

Gardosen commented 1 year ago

Describe the bug I am using the pro version of your plugin to be able to debug my code. I am using Cypress with Cucumber and Gherkin.

using the code line "debugger" inside the code, works. I also tested the test project you provided and it works for me.

But on my project for some reason, the breakpoints inside my JS code are not recognized.

Please help me :( It worked once like 10 Months ago, but i do not know what has changed since then.... I am really lost right now.

Versions:

Gardosen commented 1 year ago

@mbolotov can you help me? :(

mbolotov commented 1 year ago

Hi Marco, I had a look into it and was able to reproduce the problem. However, I currently have no idea what's wrong and how it can be fixed. I will try to investigate this issue sometime later.

Gardosen commented 1 year ago

okay, i remember when it was working for me, i had cypress 9, i wonder if anything changed in between, which broke the compatibility.

i will also make some tests with cypress 9 and my current codebase, maybe i find something which helps us nailing the issue down :)

Gardosen commented 1 year ago

@mbolotov I fixed the issue, i am not good enought to understand and dig into the cause of the issue. but i can tell that it is the esbuild-preprocessor plugin.

i replaced it now with the browserify preprocessor and the ide is stopping correctly on the breakpoints when using chrome.

I do not know if this helps you, but can it be that for cucumber with gherkin and your plugin it is necessary to use browserify and not esbuild as a preprocessor? or was i just lucky to fix it?

you can find the change i did to make it work in this branch on my example project https://github.com/Gardosen/automation-test/compare/main...cypress-support-pro-fix

i changed nothing, except what you see in the commit.

Kind regards Marco

mbolotov commented 1 year ago

Hi Marco! Thanks for this finding. I suspect your project with esbuild has a problem with generation of source maps. And debugger cannot stop on a breakpoint when no source map is present. This applies not only to the plugin's debugger, but also to any other one. For instance, the dev tools debugger in Chrome won't stop as well. Can we close this issue now?

Gardosen commented 1 year ago

Yes, we can :)