Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't make sourceMapPathOverrides to work #2032

Closed
DamienCassou opened this issue Jul 3, 2024 · 4 comments
Closed

Can't make sourceMapPathOverrides to work #2032

DamienCassou opened this issue Jul 3, 2024 · 4 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster

Comments

@DamienCassou
Copy link

I'm trying to use dapDebugServer with this configuration:

{
  "sourceMapPathOverrides" : {
    "?:*/webpack:/@foretagsplatsen/country/*" : "/home/cassou/myproject/*"
  }
}

But paths are not rewritten:

{
  "seq": 294,
  "type": "event",
  "event": "loadedSource",
  "body": {
    "reason": "new",
    "source": {
      "name": "/home/cassou/myproject/src/app/webpack:/@foretagsplatsen/country/src/app/page.jsx",
      "path": "/home/cassou/myproject/src/app/webpack:/@foretagsplatsen/country/src/app/page.jsx",
      "sourceReference": 734626073
    }
  }
}
@DamienCassou DamienCassou added the bug Issue identified by VS Code Team member as probable bug label Jul 3, 2024
@connor4312
Copy link
Member

Please share your log file using the instructions in the issue template. Thanks!

@connor4312 connor4312 added the info-needed Issue requires more information from poster label Jul 3, 2024
@DamienCassou
Copy link
Author

Thank you for your answer @connor4312. I had a look at the log file and saw that what I thought I had to rewrite was already the result of a previous rewrite. I changed the value of sourceMapPathOverrides and things work fine now:

{
  "webpack://@foretagsplatsen/country/*" : "/home/cassou/myproject/*"
}

Given that the following rewrite is part of the defaults and that it seems it should apply to my case, why do I have to setup my own sourceMapPathOverrides?

{
  'webpack://@?:*/?:*/*': "${workspaceFolder}/*",
}

Could it be that workspaceFolder is undefined for me as I'm not using VSCode but dapDebugServer.js directly?

vscode-debugadapter-921cb9ee.json.gz

@connor4312
Copy link
Member

In those logs I see the source getting parsed successfully, to a path that matches where you set the breakpoint.

{
  "name": "/home/cassou/Documents/projects/ftgp/finsit/frontend/apps/country/src/app/page.jsx",
  "path": "/home/cassou/Documents/projects/ftgp/finsit/frontend/apps/country/src/app/page.jsx",
  "sourceReference": 0
}

@DamienCassou
Copy link
Author

I will close the issue as the initial problem is solved and will open a clearer one when I come back to this. Thank you for your constant help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

3 participants
@DamienCassou @connor4312 and others