30

enter image description here

I'm trying to enable vue-devtools in Google Chrome. But I cannot enable it. I'm using vue.js inside the Laravel application.

enter image description here

My server runs using php artisan serve command.

Isuru
  • 3,558
  • 13
  • 47
  • 62
  • OK, how do you enable vue.js. Did you install it with Laravel. (Ok I don't know Laravel). However, that would be nice to know – Allan Karlson May 04 '17 at 11:26
  • No, It come as default in Laravel. https://laravel.com/docs/5.4/frontend#writing-javascript – Isuru May 04 '17 at 11:28
  • OK, as I understand do you use npm to manage all scss and javascript packages. Is that right? You may can look into your package.json which version of vue is used. Like it is explained here: https://vuejs.org/v2/guide/installation.html#Explanation-of-Different-Builds if you using the minified version it is only availble in production mode and no dev tools will work. – Allan Karlson May 04 '17 at 11:45

9 Answers9

25

I was seeing the error message in this question's title and this solution worked for me:

Add Vue.config.devtools = true to the file where you create the Vue instance (main.js for me).

Note that, as mentioned in this answer, you need to put the Vue.config.devtools = true line before you create your store in order for the Vuex part of the devtools to work. If you're creating your Vuex store in a separate file (e.g. store.js), you may need to have the Vue.config.devtools = true line in both your main.js file as well as the store.js file.

Below is what the changes looked like in my project: enter image description here enter image description here

Nathan Wailes
  • 7,748
  • 5
  • 45
  • 78
16
  1. If the page uses a production/minified build of Vue.js, devtools inspection is disabled by default so the Vue pane won't show up.
  2. To make it work for pages opened via file:// protocol, you need to check "Allow access to file URLs" for this extension in Chrome's extension management panel.
  3. I had to restart the chrome, and it worked :-)
zarpio
  • 8,868
  • 6
  • 53
  • 60
8

If your using CDN; make sure your not using a production (minified) build of the library.

Use: https://unpkg.com/vue@2.4.4/dist/vue.js

Instead of: https://unpkg.com/vue@2.4.4/dist/vue.min.js

You might need to do Ctrl+Alt+I for it to show up the first time. (Source)

bmatovu
  • 3,296
  • 1
  • 31
  • 36
4

Alternative answer for Vue CLI 3.x
Besides what @NathanWailes has said, this is an alternative which allows the Dev Tools to be available through scripts instead of writing it in your main Vue entry (which is usually main.js or index.js).

You can do this by simply adding this script to package.json

scripts: {
   "start:dev": "vue-cli-service build --mode=development"
}

Explanation
This was because Vue.config.devtools are set to false by default in production mode as said by this GitHub Issue. But this has a work around, simply by using --mode=development flag provided in the documentation.

Then you can run using npm run start:dev and check the file in your dist/ folder! ;)

Irfandy Jip
  • 1,073
  • 1
  • 13
  • 29
2

You may use the dev version of vue.js. For example get it here: https://unpkg.com/vue@2.3.2

Allan Karlson
  • 433
  • 9
  • 23
  • It comes with Laravel 5.4. If you can explain more, it would be nice. I will update the question. – Isuru May 04 '17 at 11:18
2

When using Laravel just make sure you run the proper webpack for your environment for development . Running

npm run watch

should build Vue with debug mode on. Using

npm run production

minifies Vue for production. This will save you having to remember to toggle the debug mode when building for production.

KCP
  • 835
  • 8
  • 26
1

For me Installing latest Vue dev tools - link and enabling 'Allow access to file URLs' in extension settings resolved the issue.

Manu J
  • 123
  • 8
0

make sure you're running a non-production build of Vue.js. https://github.com/vuejs/vue-devtools/issues/62

0

Just add into vue.config.js:

module.exports = {
  configureWebpack: {
    devtool: 'source-map'
  }
}

delete package-lock.json, node_modules, run npm i and VueJS Devtool will be working

sunamo.cz
  • 49
  • 5