Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vue Devtools not working locally

Vue Devtools works on all demos/examples online but not on my local pages. Even with the following, the Vue Devtools icon remains gray ("Vue.js not detected"). Why?

<html>
<head>
  <script src="https://cdn.jsdelivr.net/npm/vue"></script>
</head>
<body>
  <div id="app"></div>
  <script>    
    Vue.config.devtools = true;
  </script>
</body>
</html>
like image 820
drake035 Avatar asked Dec 02 '22 11:12

drake035


2 Answers

The Vue source you are using there looks to be minimized / production build to me. You need to use the non minimized / non-production build. Try https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.15/vue.js instead.

Also if you are working with local files i.e. accessing a page like file://... then "you need to check "Allow access to file URLs" for this extension in Chrome's extension management panel." see https://github.com/vuejs/vue-devtools

like image 91
skribe Avatar answered Jan 31 '23 07:01

skribe


You must add at-least 1 instance of vue, for the devtools to detect it. So, do:

new Vue({el: '#app'})
like image 22
samayo Avatar answered Jan 31 '23 07:01

samayo