Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging Vue.js 2 in WebStorm

Problem is that debugger not only stepping into the right source files but also its stepping into app.js file which is autogenerated by Webpack. How can I prevent it from doing that ?

I have following setup:

I initiated Vue.js 2 app using vue-cli. My debugging configuration looks like this:

debugging config

I also added this line to "webpack.dev.conf.js"; devtool: "source-map",

And I also added app.js file to exceptions in the debugger config:

enter image description here

I start server using npm run dev command, and then starting debugging session from WebStorm. Problem still exists. Any ideas ?

like image 465
RB_ Avatar asked Oct 11 '17 21:10

RB_


People also ask

How do I debug VueJS in WebStorm?

vue-debug-webstorm.md To actually debug: Run->Run->(choose the “start” configuration. Then Run->Debug->choose the “debug” configuration.

How do I enable Vue debugging?

Go to the Debug view, select the 'vuejs: chrome/firefox' configuration, then press F5 or click the green play button.

Is Vue 2 deprecated?

Vue 2 has now entered maintenance mode: it will no longer ship new features, but will continue to receive critical bug fixes and security updates for 18 months starting from the 2.7 release date. This means Vue 2 will reach End of Life by the end of 2023.


1 Answers

Please check on the following two points:

  1. Change the devtool configuration to value 'eval-source-map' or '#eval-source-map' (I don't know the difference between adding '#' sign or without '#' sign, but I tested both can work as expected) in your effective webpack configuration file.

  2. Add debug configuration just as the same step of yours. When you click that debug configuration from WebStorm, the system will automatically popup one window(Google Chrome or Firefox), please make sure you only doing your debug from this page, only the action triggered in this page is synchronized with your WebStorm Editor. This is very important!

It works from my dev env now.

like image 173
Richard Avatar answered Sep 22 '22 01:09

Richard