Disabling Specific Vue Warnings on Specific Files - vue.js

On the app I am working on, I am getting this warning:
[Vue warn]: Duplicate keys detected: '-'. This may cause an update error
This is something I can't avoid since it is how our objects are structured.
So is there any way I can disable this warning on a specific Vue file?
I have seen silent Vue config (https://v2.vuejs.org/v2/api/#silent) but this disables all the warnings. And there is also the warnHandler (https://v2.vuejs.org/v2/api/#warnHandler) but this is only for the dev mode so the warnings will still be displayed when on prod mode. I want it also disabled on prod mode.
Anyone has any idea?
Thanks!

Related

Vue warn: cannot run an inactive effect scope

I'm developing a Vue component using Storybook and trying to add console.log() statements to my Vue code to help me debug the behavior of my component, but I'm not seeing the statements printed to the console. Instead, I'm seeing a lot of warnings saying [Vue warn] cannot run an inactive effect scope..

How to avoid build failure from ESLint violations with react-scripts/create-react-app?

I created a fresh project using CRA, and then added a custom eslint config with a single rule, no-console, and set it to error log level.
When running yarn start to do development, and putting in a console log, the whole build fails and I get a generic error page saying the build failed because there was a console log. But, I put the log there to debug the app, and this isn't a production build.
I also tried seeing if this could be related to custom eslint configs so I violated the rule-of-hooks rule that is default with CRA and saw the same thing happen.
How can I develop with a linting error present?

Vue Cli remote preset crashes on Invoking Generators

i'm trying to create a remote vue cli preset on github, but for some reason i keep getting a syntax error.
My preset repo: https://github.com/christoph-schaeffer/vue-preset
The command i have entered: vue create --preset christoph-schaeffer/vue-preset testProject
The Error i get:
🚀 Invoking generators...
ERROR SyntaxError: Identifier 'router' has already been declared (15:7)
SyntaxError: Identifier 'router' has already been declared (15:7)
at Object._raise (/usr/local/lib/node_modules/#vue/cli/node_modules/#babel/parser/lib/index.js:762:17)
at Object.raiseWithData (/usr/local/lib/node_modules/#vue/cli/node_modules/#babel/parser/lib/index.js:755:17)
at Object.raise (/usr/local/lib/node_modules/#vue/cli/node_modules/#babel/parser/lib/index.js:749:17)
at ScopeHandler.checkRedeclarationInScope (/usr/local/lib/node_modules/#vue/cli/node_modules/#babel/parser/lib/index.js:4826:12)
at ScopeHandler.declareName (/usr/local/lib/node_modules/#vue/cli/node_modules/#babel/parser/lib/index.js:4792:12)
at Object.checkLVal (/usr/local/lib/node_modules/#vue/cli/node_modules/#babel/parser/lib/index.js:9367:22)
at Object.checkLVal (/usr/local/lib/node_modules/#vue/cli/node_modules/#babel/parser/lib/index.js:865:15)
at Object.parseImportSpecifierLocal (/usr/local/lib/node_modules/#vue/cli/node_modules/#babel/parser/lib/index.js:12706:10)
at Object.maybeParseDefaultImportSpecifier (/usr/local/lib/node_modules/#vue/cli/node_modules/#babel/parser/lib/index.js:12751:12)
at Object.parseImport (/usr/local/lib/node_modules/#vue/cli/node_modules/#babel/parser/lib/index.js:12677:31)
At first it worked fine, then i've added several things in the preset.json along with a generator template.
After getting the error i've tried reverting the whole repo to the state it had when it was still working. However i still get that error...
I guess it's not really about the preset but instead an issue with my global babel package or something?
I'm using vue-cli version 4 and im working on a mac
Any directions on how i could get this running would be highly appreciated
I've found the issue.
First: the vue cli somehow seems to cache remote presets. That's the reason why it didn't work even after reverting changes.
The actual issue was, that the main.js shouldn't be changed like the other template files and needs special attention. For some weird reason it gives those random errors as soon as you have a main.js in your template.
If anyone is curious on how to modify your main.js in a preset check out :
https://cli.vuejs.org/dev-guide/plugin-dev.html#changing-main-file

How to test more than 2 components using VeeValidate?

When I try to test 2 components (with 2 different test files), just the first file will pass.
The second will fail with [Vue warn]: Error in directive validate bind hook: "TypeError: Cannot read property '$scopedSlots' of undefined".
I'm really failing to get this working. Has anyone seen/solved this problem?
Already placed issues at VeeValidate and vue-test-utils.
You can reproduce this behavior here: https://github.com/jourdanrodrigues/v-validate-issue
Just clone, install and npm run test:unit. You'll see the error.
you need to add sync: false to the mount/shallowMount options.
see https://vue-test-utils.vuejs.org/api/options.html#sync

Does VueJS production mode remove all warning

Inside VueJS deployment doc, they say that in production mode warnings are not displayed
https://v2.vuejs.org/v2/guide/deployment.html
However, these warning strings become useless in production and bloat your app’s payload size
Does every warning are not displayed anymore or some of this warnings can't still be there, especially compilation error ?
It seems weird that compilations errors displayed in vue warning on dev mode cannot be seen in prod mode.
Furthermore compilation error can break other non VueJS scripts.