Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let userland remove the production tips info #4907

Closed
wants to merge 3 commits into from
Closed

Let userland remove the production tips info #4907

wants to merge 3 commits into from

Conversation

smolinari
Copy link

@smolinari smolinari commented Feb 11, 2017

Hi,

From the discussions here:

https://forum.vuejs.org/t/hide-notify-you-are-running-vue-in-development-mode/5661

and here:

aa6f7b4

and because it also annoys me, I decided to try and set up a flag, which will allow a dev to "consciously" remove the production tips info.

It is also related to (requires) this PR for the webpack template.

vuejs-templates/webpack#510

The flag is currently set to "false", so the client dev will have to go into the file and set it to true, to remove the production tips info.

If you let me know how to best document the availability of the flag (if the two PRs get accepted), I'd be also glad to add into about the flag to the docs too.

Also, this currently only works for the webpack setup. I haven't looked into the other build possibilities.

Scott

Copy link
Member

@znck znck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yyx990803
Copy link
Member

Thanks for the PR, but using process.env is actually not ideal, because if the user neglected to provide this env var e.g. via Webpack's DefinePlugin, Webpack will attempt to emulate process by including a process shim module. The standalone build config also needs to change to make sure this reference to process is built-away.

I think it's better to just add a runtime config option. We will likely address this in the next release.

@yyx990803 yyx990803 closed this Feb 12, 2017
@smolinari
Copy link
Author

smolinari commented Feb 13, 2017

Hi Evan. ( @yyx990803 )

Thanks for addressing the suggestion.

I had a feeling I was skating on thin ice with this solution, but I didn't want to disrupt what seems to be a "no configuration" mantra of Vue too much and this was the only way I could figure it out.

On that point, it seems to me, this mantra is what makes the warning necessary in the first place. There are certainly clear decisions that userland should make, one being setting up Vue for development or production and I think it is ok to allow that as a config setting.

So, I request this not simply be a decision to remove the warning with an extra flag, but rather to have a clear setting for userland to setup Vue to run in "production" or "development" mode. This would negate the necessity of the warning altogether, because the situation "production" or "development" is then a userland responsibility and not a possible mistake of using Vue incorrectly.

Scott

P.S. don't forget to close the other PR in the Webpack Template. 😄

@jaketoolson
Copy link

I loathe the fact Vue is the only package of 50+ I use that actually adds something like this to console. It's frustrating.

@posva
Copy link
Member

posva commented Mar 5, 2017

@jaketoolson This has already been released: Vue.config.productionTip = false

@smolinari
Copy link
Author

Thank you Vue team for taking my suggestion to heart and making it happen! 👍

Scott

@shepelevstas
Copy link

Somehow Vue.config.productionTip = false is ignored and the message appears anyway.

@shepelevstas
Copy link

Made it work. Had to put it right after vue.js:

...
<script src=".../vue.js">
<script>Vue.config.productionTip=false</script>
<script src=".../vuex.js">
<script src=".../vue-router.js">
...

@drupal999
Copy link

:8080/#/:6 Error parsing a meta element's content: ';' is not a valid key-value pair separator. Please use ',' instead.

@MartinManev
Copy link

I am setting productionTip and devtools to false, but I'm still occasionally getting the messages printed in the console. Sometimes during testing too. It's really annoying.

@LLily7
Copy link

LLily7 commented May 20, 2019

It's annoying me too

@garyo
Copy link

garyo commented Nov 6, 2019

Vue.config.productionTip=false is working for me, but could there be a similar tip-removal config flag for the "Download the Vue Devtools extension" message? I don't want to turn off devtools altogether in my unit tests, because sometimes it's useful to have that for debugging. I just don't always want my tests to show this message. It clutters the output.

@gubikmic
Copy link

gubikmic commented Mar 5, 2021

To anyone coming here via search: This no longer works in Vue 3.
You have to include https://unpkg.com/vue@next/dist/vue.global.prod.js to get rid of the warning.

@gubikmic
Copy link

gubikmic commented Mar 5, 2021

I realized when using the prod version the Vue DevTools no longer work.

Why was this removed in Vue 3?

I find it really distracting to get this message on every single reload.

@smolinari
Copy link
Author

AFAIK, and looking at a Vue 3 app, this warning is no longer there. 🤔

Scott

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet