Vue.js is detected on this page. Devtools inspection is not available because it's in production mode or explicitly disabled by the author - google-chrome

I'm trying to enable vue-devtools in Google Chrome. But I cannot enable it. I'm using vue.js inside the Laravel application.
My server runs using php artisan serve command.

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:

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.
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.
I had to restart the chrome, and it worked :-)

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)

Updated Aug 2022
So apparently as #kissu said, the answer below causes the released code to be an unoptimized one. This might be different than what you want if you want to check production code while being able to check Vue Dev Tools.
Just be aware of it. Unless you don't mind checking the released code in an unoptimized bundle, then the following script is fine. If you don't like the Vue.config.devtools value being static, it might be time to consider env variables or something similar.
Here's how to setup Environtment Variables in Vue
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! ;)

You may use the dev version of vue.js. For example get it here: https://unpkg.com/vue#2.3.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.

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

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

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

you could try to set environment variable NODE_ENV to 'development'
(e.g. set NODE_ENV=development on Windows or export NODE_ENV="development" under Linux)
before launching Vue dev server.

In my case for Laravel 9 fresh installation, I forgot to run sail npm run dev.

If you're using Vite you can configure your environment directory via shared options. If you change that and have NODE_ENV set to production you'll receive this message when trying to inspect your app.

Related

Shopware 6 Hot Module Reloading in Production mode does not reload compiled files

I am using the production version of Shopware 6.4.7 with my own custom theme installed and activated. When I start the watcher via bin/watch-storefront.sh the live reload server seems to start normally and compiles my files. When I go to the live reload URL with the supplied port (http://shopware1.local:8889) I can see my website and previous SCSS changes are compiled.
What does not happen is the following:
JS changes are not compiled
I do not see any logging I would expect when running HMR
SCSS changes are not reloaded, even though my terminal output states they are recompiled
JS changes are not reloaded, even though my terminal output states they are recompiled
When I run a full build using bin/build-storefront.sh all assets are compiled as expected. What could be the issue here?
For anyone who also ran into this: After re-installing my setup I figured it out; you should set up the site in dev mode in order for livereload to work. Contrary to what the SW6 training video's specify.

URL paths that work in Vue 2 and Laravel 8?

I'm working on a vue/laravel project and can't use one url path for both the dev environment (npm run hot) and production environment (php artisan serve).
This CSS example works only for php artisan:
background: url("../images/image.png")
while this only works for npm run hot:
background: url("/public/images/image.png")
Is there a method that works in both?
As far as I know you should refer to from src. So moving the image.png to /src/images/image.png it would be something like background: url("#/images/image.png"), as # refers to src.
EDIT: Approach with laravel and vue-cli
If you need to set up different path´s for your enviroments, vue-cli could be your choice. This gives you the possibility to create a vue.config.js and set up a publicPath for your enviroments.
Further Information: Integrate Laravel with a Vue CLI app
I've ended up just using php artisan serve with hot reload instead of using npm run hot. Now I have only one dev environment. You can see here how to set it up.

Can I install modules to my wildfly through cli in domain mode?

First question is supported, to manage add module from one point to all host?
If I run my wildfly domain mode I can't run this
[domain#127.0.0.1:9999 /] module add --name=com.oracle.jdbc --resources=/path/to/ojdbc6.jar --dependencies=javax.api,javax.transaction.api
answer:
The command is not available in the current context (e.g. required subsystems or connection to the controller might be unavailable).
The module operation doesn't work in domain mode because it copies the files locally.
One solution also is to use galleon to provision your modules
I found a very good blog:
https://in.relation.to/2017/05/29/creating-patches-for-wildfly/
This works. If you will add a module to modules/com/.. then in the projekt you have to put modules/system/layers/base/com/..
So you can manage the differences of wildfly-s.

How to perform grunt remote debug in IntelliJ IDEA?

I build and run my typescript application by Grunt and connect(grunt-contrib-connect) and livereload plugins. While grunt compile .ts files, it also generate sourcemap. My application is oppening on google chrome. How can I remotely connect by Intellij Idea to this application that was run by Grunt and oppened in Chrome for perform debug?
This post is my last hope, that it is possible. Thanks
create a new javascript debug run configuration
in URL field, specify the URL of your client app (http://localhost:9001/index.html or whatever it looks like)
if your local project structure doesn't exactly match the app structure on server (for example, static files are served from <project_root>/public folder), specify remote URL mappings (see http://confluence.jetbrains.com/display/WI/Starting+a+JavaScript+debug+session#StartingaJavaScriptdebugsession-Startingadebugsessionwhenusingadifferentwebserver)
that should be enough... Start grunt, and, when the server is up and running, debug the configuration above
Thank you. I found solution.
First of all, I need Jet Brains extension for Chrome.
I need to make configure debug mode "JavaScript debug" and specify URL that grunt will run and open application.
Run Grunt task that build and open application in browser.
Run debug mode that just reload same page under debugger already.
Don't forget enjoy it.
Since I use typescript, ability to debug in IDE was very important.

Chrome allow file access from files no longer working (was using to see WebGL/three.js files)?

I was using a Chrome shortcut with allow-file-access-from-files in the target to work on my three.js student project files. But sometime this morning this stopped working and it appeared Chrome had been updated. I redid the shortcut but no joy.
Part of the project I'm doing is building three.js animation that works in a common browser (for which I chose Chrome).
Is there any way to get Chrome to allow file access again?
Thanks.
The answer I came up with was to use Firefox instead of Chrome changing the security policy as detailed in https://github.com/mrdoob/three.js/wiki/How-to-run-things-locally
Not a perfect answer but with a deadline looming it's the best workable answer for me right now as trying different variations of Chrome, trying Wamp and also Mongoose didn't work. If I had more time I would work out how to use Python or probably node.js as I've seen it mentioned a number of times as being the faster option.
What gman stated is true, using the Chrome flag (and changing Firefox's security policy) does create a big security risk. But only if you use that shortcut (and it's tabs etc.) for anything other than accessing your own local files. I've been scrupulous about not using it for the internet but don't use this method if you can't be strict with yourself.
Ideally I'd recommend beginning any project with node.js.
Gman's answer is good. If you're in windows environment, and use npm for package management the easiest is to install http-server globally:
npm install -g http-server
Then simply run http-server in any of your project directories:
Eg. d:\my_project> http-server
Starting up http-server, serving ./
Available on:
http:169.254.116.232:8080
http:192.168.88.1:8080
http:192.168.0.7:8080
http:127.0.0.1:8080
Hit CTRL-C to stop the server
Easy, and no security risk of accidentally leaving your browser open vulnerable.
DON'T USE THAT FLAG! You're opening yourself to having your online accounts being hacked and your local data stolen. Here are 2 proof of concept examples
Run a simple server.
It's super simple.
Here's one
Here's one.
Here's another.
And another.
They won't take more than a couple of minutes to download and require no configuration