Open bromix opened 3 years ago
Here are the screenshots that are also included with the sample project with description.
wrong file
source-map not the same as with vue v2
I am curious why more people are not +1'ing this issue. I have never had any success debugging Vue3 composition API, with Typescript, in VSCode. It is substantially broken.
I am curious why more people are not +1'ing this issue. I have never had any success debugging Vue3 composition API, with Typescript, in VSCode. It is substantially broken.
+1, exactly the same.
and I am curious about this too.
I, too, wonder why more people haven't asked about this issue. This excellent article, with some minor changes and customizations, got me to a working solution:
@hamstreet Probably because I'm using vue-cli v5.0.0-beta.7, no App.vue(?xxxx) in the Chrome source tab has the template/script tags, so that article got off to a bad start. I guess I'll have to keep dreaming of the day when I can set a breakpoint in VSCode rather than littering debugger;
statements everywhere.
Link to issue #11023, Generate distinct paths for supporting .vue files in sourcemaps.
I, too, wonder why more people haven't asked about this issue. This excellent article, with some minor changes and customizations, got me to a working solution:
@hamstreet Care to share your changes? I figured out I had to change _sourceMap
to _sourceMapAsObject
but had no more time to spend on it after that.
Still having this problem. I spent 4 hours on this. Are the any workaround or fix?
I've tried in vain to get this working with no joy, even with andrewmackrodt's hard work.
This is Vue 3.
Workaround from this https://github.com/vuejs/vue/issues/11023#issuecomment-789137369 works for me. I`m able to debug vuejs in Chrome.
I`m waiting for this issue to be resolved.
Version
4.5.13
Reproduction link
https://github.com/bromix/vue3-sourcemaps-not-working
Environment info
Steps to reproduce
For Vue v3 change to the "vue3app" directory and then run the following commands.
In Visual Studio Code just start the debugger with F5 and then click on one of the buttons.
What is expected?
That the breakpoints jump to the right place in the code.
What is actually happening?
Either nothing happens (if a breakpoint is set) or the debugger jumps to the wrong place (if debugger statement is used).
For a direct comparison, I have attached the same project with Vue v2 (everything works there).
I describe the case here in more detail, because we are working on a large project for about a year. We use Vue v2, Vuetify and Composition API. We use only TypeScript (we have additional experience with C/C , Python and C#/dotnet and are used to work with a debugger for more complex errors). We have prepared everything thanks to the Composition API addon for Vue v3 and now in the first tests we found that we can't debug properly.
If there is anything further I can try or test, just give me instructions. Currently, my guess is that the source maps are not being created correctly. But only if TypeScript is used. In pure JavaScript there are no problems, but this is not reasonable from a certain size of project.