简体   繁体   中英

Debugging in WebStorm with Vue.js

I'm debugging a Nuxt + Vue.js application and need to see the description of an object being passed to one of my components' methods. I'd also like to step through that method to see what's wrong with it.

I'm using WebStorm and have read the following from here :

在此处输入图片说明

I did what was instructed above and after running "npm run dev" and then hitting debug in WebStorm, my page loads in Chrome but the breakpoints I've set are never hit.

I know my method gets hit because I can see its faulty results in my Vue app running in Chrome.

I've tried using the Vue Devtools in Chrome as well, which is great, but doesn't provide the step-through functionality I'm looking for. Or if it does, I don't know about it.

Here's my Javascript debug configuration:

在此处输入图片说明

Could this be something to do with the order a Vue project is loaded into the browser? I'm still pretty new to Vue.js so any help would be appreciated.

I'd suggest setting up Nuxt to use devtool = 'source-map' for sourcemaps generation (see https://nuxtjs.org/api/configuration-build/#extend for example) to make sourcemaps more accurate. Works fine for me:

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM