-
-
Notifications
You must be signed in to change notification settings - Fork 597
Debug Vue apps with sourcemap #201
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
Comments
Debugging *.js files in Vue app is not difficult, there are plenty of tools. Debugging |
Is there any update about debugging <script /> block in *.vue files using vscode? I find that even I debug in chrome with built-in developer tools, some lines of code in *.vue files still not be abled to set a breakpoint on it. Instead the breakpoint is set directly in its corresponding source code line. Any workaround? |
@CXHtml That's because the sourcemap is too messed up. When using webpack, try using If you can't set breakpoint on a line in Chrome devtools, it's not possible to do that in VSCode either since VSCode debugging for Vue is using Chrome Debuging Protocol. In Veturpack, I already included a @TheLarkInn Just a reminder to push for a formal sourcemap spec :-) |
@CXHtml I use |
@myst729 Yep It doesn't work reliably. But others didn't even work... |
Hi, I just go through the discussion Microsoft/vscode-chrome-debug#430 u guys mentioned above, and in the hacker news 2 example, I think temporarily the way we can debug with *.vue and any other imported *.js files is to override the "webpack://" path explicitly according to the info in vscode debug console after entering
I know this may looks verbose, but it actually works for any script you want to debug with Debugger for Chrome (yep, use |
@CXHtml I think currently there isn't any workaround. |
Hi myst729, that really sounds great, can you please tell the quick steps to set it up? Thanks :) What text need to go in what files? |
Finally debugging! I just run multiple debug test with vue router also. LINK: First i ran a fresh install of vue (https://vuejs.org/v2/guide/installation.html) Then: VS Code:
And by updating devtool: 'source-map' in dev within config/index.js to update the webpack config. LINK: |
@martinandersen3d Thanks, I'll sync with @auchenberg and update the doc on Vetur later. |
I know this is somewhat of a unique use case, but I'm trying to get debugging working in a development environment that uses both Vue and JavascriptServices. I'm trying to merge the configuration mentioned in both this issue and here, but I'm having some difficulty. To add to the confusion, I couldn't find a popular template that uses both JavascriptServices and the vue-cli template. This and this seem to be the most relevant templates right now (for my projects I just throw the whole vue-cli template into the ClientApp folder [which has its own issues]). This might be outside of the scope of this issue (I know it's impractical to create documentation for every person's development environment) but I noticed VS Code Vue debugging being tackled in the Roadmap for January 2018 and thought it might be a good time to ask. |
@jsfeldman https://github.com/Microsoft/vscode-recipes/tree/master/vuejs-cli might be useful to you. I'm not familiar with js services but you want to make sure it generates correct sourcemap. |
I see, makes sense. I'll look into it. Thanks! |
Thanks to @auchenberg, a recipe for debugging Vue app in VS Code is now available at: https://github.com/Microsoft/vscode-recipes/blob/master/vuejs-cli/README.md |
As in https://github.com/Microsoft/vscode-chrome-debug/issues/430, vue already has some config for sourcemap debugging. However, there is no clear doc for setting up, and there are a lot of pitfalls.
Todo:
The text was updated successfully, but these errors were encountered: