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.

TypeError: Cannot read property 'language' of undefined

See original GitHub issue

When I execute with eslint command, I can run normally

./node_modules/.bin/eslint XXX.jsx

I use the atom editor, eslint can also run the right

But when I use eslint plug-in, the console is wrong, the error message is as follows:

[Info  - 4:47:34 PM] ESLint server is running.
[Info  - 4:47:36 PM] ESLint library loaded from: /Users/liyi/Workspace/ws_ai_mdp/ai-mdp-web/node_modules/eslint/lib/api.js
[Error - 4:47:36 PM] ESLint stack trace:
[Error - 4:47:36 PM] TypeError: Cannot read property 'language' of undefined
    at Object.keys.forEach.key (/Users/liyi/Workspace/ws_ai_mdp/ai-mdp-web/node_modules/eslint/lib/config/config-ops.js:180:75)
    at Array.forEach (native)
    at deepmerge (/Users/liyi/Workspace/ws_ai_mdp/ai-mdp-web/node_modules/eslint/lib/config/config-ops.js:177:30)
    at Object.keys.forEach (/Users/liyi/Workspace/ws_ai_mdp/ai-mdp-web/node_modules/eslint/lib/config/config-ops.js:159:34)
    at Array.forEach (native)
    at deepmerge (/Users/liyi/Workspace/ws_ai_mdp/ai-mdp-web/node_modules/eslint/lib/config/config-ops.js:150:38)
    at Object.keys.forEach.key (/Users/liyi/Workspace/ws_ai_mdp/ai-mdp-web/node_modules/eslint/lib/config/config-ops.js:181:32)
    at Array.forEach (native)
    at Object.deepmerge [as merge] (/Users/liyi/Workspace/ws_ai_mdp/ai-mdp-web/node_modules/eslint/lib/config/config-ops.js:177:30)
    at Config.getConfig (/Users/liyi/Workspace/ws_ai_mdp/ai-mdp-web/node_modules/eslint/lib/config.js:341:28)

My eslint configuration file “.eslintrc.json ” is as follows:

{
    "parser": "babel-eslint",
    "parserOptions": {
        "ecmaVersion": 6,
        "sourceType": "module",
        "ecmaFeatures": {
            "jsx": true,
            "impliedStrict":true
        }
    },
    "extends": [
        "eslint:recommended"
    ],
    "plugins": [
        "react"
    ],
    "env": {
        "browser": true,
        "commonjs": true,
        "es6": true
    }
}

The eslint plug-in version number of my vscode editor is 1.4.8 The dependencies configured in package.json are as follows:

{
  "devDependencies": {
    "autoprefixer": "7.1.6",
    "babel-core": "^6.26.0",
    "babel-eslint": "^8.2.2",
    "babel-loader": "^7.1.4",
    "babel-plugin-import": "^1.6.7",
    "babel-plugin-transform-decorators-legacy": "^1.3.4",
    "babel-preset-react-app": "^3.1.1",
    "babel-runtime": "^6.26.0",
    "eslint": "^4.19.1",
    "eslint-config-airbnb": "^16.1.0",
    "eslint-plugin-html": "^4.0.2",
    "eslint-plugin-import": "^2.10.0",
    "eslint-plugin-jsx-a11y": "^6.0.3",
    "eslint-plugin-react": "^7.7.0",
   }
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:22 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
JonWallstencommented, Apr 12, 2018

So, it turns out that uninstalling an extension is not actually removing it in the extension folder. So when you install again, it still the same old files. I removed eslint and stylelint and installed both again. Voila! No error! Thanks guys!

0reactions
JonWallstencommented, Apr 13, 2018

@alexandrudima @sandy081: Just an FYI. I did press the “Restart” button between uninstall and install. Good to know there’s a Reinstall. Will use that next time. Thanks again!

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot read property 'language' of undefined
Create jest-setup.js file (if already not exists) and add following lines in that import { NativeModules } from 'react-native'; ...
Read more >
Cannot Read Property of Undefined in JavaScript - Rollbar
TypeError: Cannot read property of undefined occurs when a property is read or a function is called on an undefined variable.
Read more >
Uncaught TypeError: Cannot read property of undefined In
Uncaught TypeError: Cannot read property of undefined error occurs in Chrome when you read a property or call a method on an undefined...
Read more >
Cannot read property of 'language' of undefined #4 - GitHub
I'm playing around with the example provided. I copied over the code in verbatim to see how it works. Ran npm install and...
Read more >
Uncaught TypeError : Cannot read properties of undefined
The solution to TypeError: Cannot read properties of undefined ... The root cause of the error is that the declared variable doesn't have...
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