You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the Run and Debug tab, select fullstack: nuxt and wait for the server and Chrome to finish
Make sure the inspector is open in Chrome
Add a breakpoint to TestComponent (e.g. on line 10 const b = ref(false))
Reload the page
This will successfully break in Chrome and VSCode, this works perfectly
Skip over and remove the breakpoint
Set the same breakpoint int the index.vue page (same line)
You'll notice it won't really set the breakpoint visually, but it'll appear in the breakpoints section (it might show a greyed out circle, instead of a red one)
Reload the page
Break will happen at the wrong line in Chrome (12 instead of 10) and the compiled index.vue file is shown in VSCode, instead of the original SFC
Skip over and remove the breakpoint again
Now in Chrome, set a breakpoint at line 10 for index.vue
Reload the page
Breakpoint will be correct in Chrome, but still open the compiled index.vue in VSCode.
Expected result:
To always open the original SFC, regardless of it being a component or page, and not the compiled version.
To be able to directly set breakpoint in pages in VSCode
Describe the bug
When debugging in VSCode through the "Run and Debug" tab, you can set breakpoints in your components and composables just fine. They'll be mapped to the right source in Chrome and everything seems to work.
However, when you try to do the same thing for pages, things get a bit strange, as the breakpoint won't be set properly (sometimes in completely the wrong place) and won't be mapped back to the original page's SFC, but to the transpiled version instead.
My best guess would be that when pages are generated from components (i.e. the routes are being created, etc), these SFC's get interpreted/transpiled and those files become the source for the breakpoints.
Thanks for reporting the issue. I guess @danielroe is also tracking it but seems source map for pages components is not updated with a transform plugin that changes the line order.
(Preserving map to original source contents could be also a nice improvement)
Environment
Darwin
v16.15.1
3.0.0-rc.8
npm@8.12.1
vite
-
-
-
Reproduction
https://github.com/TheDutchCoder/nuxt-app-dx
Steps to follow:
npm i
Run and Debug
tab, selectfullstack: nuxt
and wait for the server and Chrome to finishconst b = ref(false)
)index.vue
page (same line)breakpoints
section (it might show a greyed out circle, instead of a red one)Expected result:
Describe the bug
When debugging in VSCode through the "Run and Debug" tab, you can set breakpoints in your components and composables just fine. They'll be mapped to the right source in Chrome and everything seems to work.
However, when you try to do the same thing for pages, things get a bit strange, as the breakpoint won't be set properly (sometimes in completely the wrong place) and won't be mapped back to the original page's SFC, but to the transpiled version instead.
My best guess would be that when pages are generated from components (i.e. the routes are being created, etc), these SFC's get interpreted/transpiled and those files become the source for the breakpoints.
Additional context
We have a thread with @danielroe on Discord for reference as well: https://discord.com/channels/473401852243869706/1011385390613156000
Logs
No response
The text was updated successfully, but these errors were encountered: