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

See original GitHub issue

my error when i type style attribute:

TypeError: Cannot read property 'type' of null
    at Object.astHelpers.hasArrayOfStyleReferences (/home/afdalwahyu/Documents/projects/gagclone/node_modules/eslint-plugin-react-native/lib/util/stylesheet.js:312:11)
    at Object.astHelpers.collectStyleReferences (/home/afdalwahyu/Documents/projects/gagclone/node_modules/eslint-plugin-react-native/lib/util/stylesheet.js:157:20)
    at EventEmitter.JSXAttribute (/home/afdalwahyu/Documents/projects/gagclone/node_modules/eslint-plugin-react-native/lib/rules/no-unused-styles.js:46:35)
    at emitOne (events.js:95:20)
    at EventEmitter.emit (events.js:182:7)
    at NodeEventGenerator.enterNode (/home/afdalwahyu/Documents/projects/gagclone/node_modules/eslint/lib/util/node-event-generator.js:40:22)
    at CodePathAnalyzer.enterNode (/home/afdalwahyu/Documents/projects/gagclone/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:608:23)
    at CommentEventGenerator.enterNode (/home/afdalwahyu/Documents/projects/gagclone/node_modules/eslint/lib/util/comment-event-generator.js:97:23)
    at Controller.enter (/home/afdalwahyu/Documents/projects/gagclone/node_modules/eslint/lib/eslint.js:927:36)
    at Controller.__execute (/home/afdalwahyu/Documents/projects/gagclone/node_modules/estraverse/estraverse.js:397:31)

.eslintrc rules that make eslint show error

  "rules": {
    ....
    "react-native/no-unused-styles": 2,
    .....
  }

I’m using

eslint-plugin-react-native@2.0.0

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
afdalwahyucommented, Nov 30, 2016

I’m upgrading and it’s works perfectly. I’m upgrading from 2.0.0 to 2.2.0 and it works now. Thanks for your good work 👍

1reaction
afdalwahyucommented, Nov 20, 2016

I’m using atom with linter & linter-eslint packages. here is my .eslintrc file, idk maybe helpful or not 😃

{
  "extends": "airbnb",
  "env": {
    "mocha": true
  },
  "plugins": [
    "react-native"
  ],
  "globals": {
    "fetch": false
  },
  "parser": "babel-eslint",
  "rules": {
    "no-empty-label": 0,
    "no-console": 0,
    "import/no-unresolved": 0,
    "global-require": 0,
    "no-underscore-dangle": 0,
    "space-before-keywords": 0,
    "space-after-keywords": 0,
    "space-return-throw-case": 0,
    "react/prefer-stateless-function": 0,
    "react/jsx-filename-extension": 0,
    "react-native/no-unused-styles": 2,
    "react-native/split-platform-components": 2,
    "no-use-before-define": 0,
    "react/prop-types" : 0,
    "react/forbid-prop-types" : 0,
    "class-methods-use-this" : 0,
    "no-bitwise": [2, {"allow": [">>", "&"]}]
  }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot read property 'type' of null - Stack Overflow
I resolve it by installing the @angular/cdk 8.0.0 version. When I installed 8.2.3, as build would report error as Cannot read property 'type'...
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 >
Improve error message: TypeError: Cannot read property 'type ...
If library-b is installed that way, then ng build library-a fails with "Cannot read property 'type' of null" (only if components are listed...
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 >
How to Avoid the Infamous "Cannot read properties of ... - Bitovi
... two ways of interpreting null and undefined types and one of them can avoid the 'Cannot read properties of undefined' runtime TypeError....
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