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 'value' of null

See original GitHub issue

Tell us about your environment

  • ESLint Version: v4.15.0
  • Node Version: v8.9.4
  • npm Version: 5.6.0

What parser (default, Babel-ESLint, etc.) are you using?

  • babel-eslint

Please show your full configuration:

Configuration
module.exports = {
	parser: "babel-eslint",
	rules   : {
		'arrow-body-style' : ['warn', 'as-needed'],
	},
};

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

test = () => { return }
./node_modules/.bin/eslint FILE

What did you expect to happen?

Eslint to lint the file

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

Error received TypeError: Cannot read property 'value' of null

Cannot read property 'value' of null
TypeError: Cannot read property 'value' of null
    at Object.isOpeningBraceToken (./node_modules/eslint/lib/ast-utils.js:354:18)
    at validate (./node_modules/eslint/lib/rules/arrow-body-style.js:119:41)
    at listeners.(anonymous function).forEach.listener (./node_modules/eslint/lib/util/safe-emitter.js:47:58)
    at Array.forEach (<anonymous>)
    at Object.emit (./node_modules/eslint/lib/util/safe-emitter.js:47:38)
    at NodeEventGenerator.applySelector (./node_modules/eslint/lib/util/node-event-generator.js:251:26)
    at NodeEventGenerator.applySelectors (./node_modules/eslint/lib/util/node-event-generator.js:280:22)
    at NodeEventGenerator.leaveNode (./node_modules/eslint/lib/util/node-event-generator.js:303:14)
    at CodePathAnalyzer.leaveNode (./node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:630:23)
    at Traverser.leave [as _leave] (./node_modules/eslint/lib/linter.js:1001:32)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
josemigallascommented, Jul 9, 2018

Getting exactly this error with following: .eslintrc

{
    "extends": "airbnb",
    "rules": {
        "quotes": ["error", "double"],
        "comma-dangle": ["error", "never"],
        "arrow-parens": ["error", "as-needed"],
        "curly": ["error", "all"],
        "brace-style": ["error", "1tbs"],
        "padded-blocks": ["error", { "classes": "always", "blocks": "never" }],
        "object-curly-newline": [
            "error",
            {
                "ImportDeclaration": { "multiline": true, "minProperties": 3 }
            }
        ],
        "indent": ["error", 4],
        "class-methods-use-this": "off",
        "import/prefer-default-export": "off",
        "react/jsx-filename-extension": "off",
        "react/jsx-one-expression-per-line": "off",
        "react/prop-types": "warn",
        "react/jsx-indent": ["error", 4],
        "react/jsx-indent-props": ["error", "first"],
        "react/button-has-type": "off",
        "react/destructuring-assignment": "warn",
        "jsx-a11y/label-has-for": "off"
    },
    "plugins": ["mocha"],
    "env": {
        "mocha": true,
        "browser": true
    }
}

.babelrc

{
  "presets": ["env", "react"],
  "plugins": ["transform-object-rest-spread"]
}

dependencies

"eslint": "^4.19.1",
"eslint-config-airbnb": "^17.0.0"
"eslint-plugin-import": "^2.13.0"
"eslint-plugin-jsx-a11y": "^6.0.3"
"eslint-plugin-mocha": "^5.0.0"
"eslint-plugin-react": "^7.10.0"

node v8.11.2
npm 6.1.0
0reactions
not-an-aardvarkcommented, Aug 24, 2018

If this is still happening with the latest version of ESLint, may you please open a new issue? Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught TypeError: Cannot read property 'value' of null
I'm getting error in this code, I'm trying to do an event where in when the page is load, it will do the...
Read more >
Uncaught TypeError: Cannot read property of null - iDiallo
This error occurs when you read a property or call a method on a null object . That's because the DOM API returns...
Read more >
How to deal with TypeError: cannot read properties of null
While coding in Javascript, you must have at least once received a Type Error which has the message “cannot read properties of null”....
Read more >
"Cannot read property 'value' of null" while linting · Issue #13394
ESLint: 7.1.0 TypeError: Cannot read property 'value' of null Occurred while linting /Bot/Swan-dev/src/SwanClient.js:74 at ...
Read more >
Uncaught TypeError Cannot read property value of null
Uncaught TypeError Cannot read property value of null ... $(document).ready(function(){ var str = document.getElementById("cal_preview").value; ...
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