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
The debugger does not work in a monorepo when bundle size and sourcemaps go over a certain size #1948
Comments
Thanks for the good repro. This is likely because you're debugging minified code. Minified code will rename variables and have control flow changes so that lines and stepping may not work in the same way you expect them to with a 1:1 compilation. Your minifier also does not appear to making a rename entry for For a better developer experience, I recommend configuring your tools to not minify your code in dev mode. |
@connor4312 I don't believe its due to magnification. The code is always minified.
|
What do you mean when you say "see runtime data"? Is the Variables view not populating? For example, in coffeeRes, the intermediate variable is not emitted in generated code at all.
gets minified as
So there is no I recommend changing your wranger config to only minify your code in production. |
The locals work for me without commenting things out -- could you share a trace log for a debug session where you get into the "stuck" state? It looks like the logs in the original issue were okay.
Can you push the code with that function to a branch in your repo? |
@connor4312 here is the trace with the module disabled here is the trace with modules enabled |
Thanks, I was able to reproduce the errors, seems like we had an off-by-one error which was pretty hard to see in unminified code, but in minified code where everything is one line it's more apparent. I still didn't repro the case of the Variables view loading and never showing data -- do either of the log files you shared represent that? |
@connor4312 The loading spinner was just with
size minified vs unminified
vscode-debugadapter-d4cd0037.json.gz |
Thanks, I can reproduce with that. This is actually the runtime freezing when we ask for the source of worker.js, which is needed in order to compute renames. I was able to reproduce the issue in Chrome and have opened an issue for the folks who work on V8: https://issues.chromium.org/issues/326554286 You can set I will close this issue again as I fixed the problem that was on our side in the linked PR. |
thanks a lot for your help! @connor4312 |
@connor4312 can you provide verification steps for the part that you fixed? |
|
Describe the bug
The debugger does not work in a monorepo when bundle size and sourcemaps go over a certain size.
The locals (variable view on hover) stops working. And the line number of sourcemaps changes and is mismatched.
To Reproduce
I've create a reproduction repo with a gutted version of my project
https://github.com/ShravanSunder/vscode-debug-reproduction
@connor4312 i've invited you to it the project, please let me know if you can see it
I've tried many launch configurations with sourcemap settings for attching to the worker debugging.
In cloudflare's chrome debugger the line numbers and local variables values show up and are perfect. It seems to only be an issue with vscode debugger.
Log File
here is the trace:
vscode-debugadapter-04909eb4.json.gz
VS Code Version: 1.86.2
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: