question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error while loading rule 'vue/no-confusing-v-for-v-if': Cannot convert undefined or null to object

See original GitHub issue

Error while loading rule ‘vue/no-confusing-v-for-v-if’: Cannot convert undefined or null to object

Tell us about your environment

  • ESLint Version: 3.19.0
  • eslint-plugin-vue Version: 3.13.0
  • Node Version: 8.4.0

I’m using ESLint in Visual Studio Code. But the same issue appears in console.

Please show your full configuration:

{
  "extends": ["airbnb-base", "plugin:vue/recommended"],
  "plugins": ["vue", "html", "class-property"],
  "parser": "vue-eslint-parser",
  "parserOptions": {
    "parser": "babel-eslint",
    "ecmaVersion": 2017,
    "sourceType": "module"
  },
  "rules": {
    "import/no-unresolved": 0,
    "import/no-unassigned-import": 0,
    "import/no-extraneous-dependencies": 0,
    "import/extensions": 0,
    "class-property/rule-name": 2
  }
}

What did you do? Please include the actual source code causing the issue.

I don’t have any v-if or v-for in the project. Eslint simply never starts to lint in this conditions.

What did you expect to happen?

It starts linting

What actually happened? Please include the actual, raw output from ESLint.

> eslint client/**/*.{vue,js}

Error while loading rule 'vue/no-confusing-v-for-v-if': Cannot convert undefined or null to object
TypeError: Error while loading rule 'vue/no-confusing-v-for-v-if': Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at Object.keys.filter.forEach.key (/home/s/Git/decompose/node_modules/eslint/lib/eslint.js:872:28)
    at Array.forEach (<anonymous>)
    at EventEmitter.module.exports.api.verify (/home/s/Git/decompose/node_modules/eslint/lib/eslint.js:841:93)
    at localVerify (/home/s/Git/decompose/node_modules/eslint-plugin-html/src/index.js:107:14)
    at EventEmitter.eslint.verify (/home/s/Git/decompose/node_modules/eslint-plugin-html/src/index.js:147:18)
    at processText (/home/s/Git/decompose/node_modules/eslint/lib/cli-engine.js:264:31)
    at processFile (/home/s/Git/decompose/node_modules/eslint/lib/cli-engine.js:303:18)
    at executeOnFile (/home/s/Git/decompose/node_modules/eslint/lib/cli-engine.js:672:25)
    at fileList.forEach.fileInfo (/home/s/Git/decompose/node_modules/eslint/lib/cli-engine.js:710:13)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
404passionFruitcommented, Sep 9, 2017

Solved. I needed to remove parser at all.

{
  "extends": ["airbnb-base", "plugin:vue/recommended"],
  "plugins": ["vue", "html", "class-property"],
  "parserOptions": {
    "parser": "babel-eslint",
    "ecmaVersion": 2017,
    "sourceType": "module"
  },
  "rules": {
    "import/no-unresolved": 0,
    "import/no-unassigned-import": 0,
    "import/no-extraneous-dependencies": 0,
    "import/extensions": 0,
    "class-property/rule-name": 2
  }
}
0reactions
3Dcubecommented, Oct 20, 2017

thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot convert undefined or null to object - Stack Overflow
This error is caused when you call a function that expects an Object as its argument, but pass undefined or null instead, like...
Read more >
Cannot convert undefined or null to Object in JavaScript
The "Cannot convert undefined or null to Object" error occurs when we pass a null or an undefined value to a function that...
Read more >
<TypeError: Cannot convert undefined or null to object> #1567
After reinstalling node_modules, an error is thrown when using eslint. eslint version that throws : 2.19.0 eslint version that works ...
Read more >
Getting An "Cannot convert undefined or null to object" Error
Now everytime I try to logout I get this error message.... TypeError: Cannot convert undefined or null to object at Function.assign ...
Read more >
typeerror: cannot convert undefined or null to object - You.com
This error is caused when you call a function that expects an Object as its argument, but pass undefined or null instead, like...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found