expo/vscode-expo

can not add breakpoints

whp98 opened this issue · 12 comments

whp98 commented

Description of the bug

How would you shortly summarise the issue?

i add a breakpoints to app.js , but vscode say can not add some breakpoints

image

To Reproduce

What steps did you perform which led to this issue?

  1. i start a expo app and add a breakpoint

image

  1. my launch.json
{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "expo",
      "request": "attach",
      "name": "Debug Expo app",
      "projectRoot": "${workspaceFolder}",
      "bundlerPort": "19000",
      "bundlerHost": "127.0.0.1",
      "enableTurboSourcemaps": true
    }

  ]
}

3.vscode Code Doctor show wrong code path
image

image

  1. debugger can attach to the android emulater but my breakpoint not work
  2. i can only use the ctrl + j use chrome to debug

Expected behavior

i can add breakpoint in vscode and debug the app

Actual behavior

not working

Additional context

Can you further explain the issue? E.g., information about version/environment or screenshots.

Thanks for reporting the issue! Seems like the capitalization in the drive name throws vscode off. I'll make sure to test this a bit more on Windows.

Just out of curiosity, which one is the correct one? Is your E: drive capitalized or lower case (e:)?

whp98 commented

WINDOWS system path does not distinguish between uppercase and lowercase

The problem I'm having is that my code path seems to be repeated twice, and the directory doesn't even exist

The part on my screenshot framed in red is correct

Got the same problem. When trying to set a breakpoint it can't find the location. VS Code reports file location as workspacefolder+fullsourcefilepath - the full path of course already containing the workspace root, just like in @whp98 screenshot above.

On win11, node 20.5

Thanks for the additional information. It seems that this issue might actually be caused by the sourcemap path generation or the vscode path mixing. I'll try to investigate on a Windows machine on my end.

Likely related to this issue:


Oh boy, this issue is bigger than I thought. Seems like we are running into bugs from 2016, where modules are loaded twice depending on drive letters...

image

I just published a pre-release with a potential fix included. You can switch to this version through VS Code, more info here.

Please try version 1.2.1 and let me know if this fixes the issue for you.

I just published a pre-release with a potential fix included. You can switch to this version through VS Code, more info here.

Please try version 1.2.1 and let me know if this fixes the issue for you.

Just tried with the 1.2.1 pre-release, unfortunately still getting the same errors...

image

When the debugger attaches massive dump of path mismatches for the sourcemaps:
image

And when you try to set a breakpoint:
image

Hope this helps a little, thanks for your efforts trying to fix this!

I'm still having this exact problem with v 1.2.1 on Windows, any progress on a fix (or work around)?

It has been months and this issue is still not fixed is it even possible to debug in vscode with expo

For anyone on Windows trying to work around this. It appears that it is related to project files not being located on the same drive as the VS Code installation. For me it worked to move the project files to the same drive as the VS Code installation.

don't know why this is not mentioned anywhere this is kind of stupid tbh

same issue,someone help?

same here
seems the selected breakpoints in dev tools are not matching with the actual line the debugger is stopping